Validating a xpath against xml

try {
            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            Document document = builder.parse(new File("d:\\eqcschema\\test.xml"));
             XPath xpath =XPathFactory.newInstance().newXPath();         
            String expression = "//artinfo/pubinfo/pubname[1]";
            String pubname = (String)xpath.evaluate(expression, document, XPathConstants.STRING);
            //int val21=birthdateDouble21.intValue();
            System.out.println("Double is: " +pubname);
            expression = "count(//table)";
            Double nooftable = (Double)xpath.evaluate(expression, document, XPathConstants.NUMBER);
            int val2=nooftable.intValue();
            System.out.println("Double is: " +birthdateDouble2+"   "+val2);
            expression = "//table";
            NodeList birthdateNodels = (NodeList)xpath.evaluate(expression, document, XPathConstants.NODESET);
            for(int t=0;t<birthdateNodels.getLength();t++){
                Node table=birthdateNodels.item(t);
                expression = "tgroup/@cols";
                String expression1 ="count(tgroup/colspec)";
                Node cols = (Node)xpath.evaluate(expression, table, XPathConstants.NODE);
                System.out.println("Node sdsddssd is: " + cols);
                int colsvalue=Integer.valueOf(cols.getNodeValue());
                Double colspec = (Double)xpath.evaluate(expression1, table, XPathConstants.NUMBER);
                int val1=colspec.intValue();
                System.out.println("Node sdsddsssasad is: " +colspec+"   "+val1);
                if(colsvalue==val1){
                  System.out.println("It is Equal ");
                else{
                       System.out.println("It is Not Equal ");
            }this is how i use the xpath. is it ok using likie this.
but the problem here is .. i could display the required message but how do i get the node's line number???
is there anyother way to capture the line number????
waiting for the reply.. :(

Hi,
Search in SDN  there are many wiki's posted which gives step by step procedure.
Check with the [Validating a field against table|https://wiki.sdn.sap.com/wiki/x/CIHvB]
Hope this helps you.
Regards,
Rajani

Similar Messages

  • Vivado 2013.4 ERROR: [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order

    Hello,
    I just downloaded and installed Vivado 2013.4 on my Xubuntu 12.04 machine. But when I try to add IP from the IP catalog, as in the ug937 Lab1 step2, it fails with obscure error messages (see below).
    Here's basically what I did:
    -In the Flow Navigator, i select the IP Catalog button.
    -In the search field of the IP Catalog, I type DDS.
    -then I double-click the DDS Compiler and my error occure.
    Please Help,
    Jerome.
    [HDL 9-1061] Parsing VHDL file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/sinegen_demo.vhd" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/sinegen_demo.vhd":1]
    Analysis Results[IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [HDL 9-1061] Parsing VHDL file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/sinegen.vhd" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/sinegen.vhd":1]
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    set_property target_language Verilog [current_project]
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    sources_1[IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [HDL 9-1061] Parsing VHDL file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/sinegen_demo.vhd" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/sinegen_demo.vhd":1]
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    update_compile_order -fileset sim_1
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [HDL 9-1061] Parsing VHDL file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/fsm.vhd" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/fsm.vhd":1]
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [HDL 9-1061] Parsing VHDL file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/fsm.vhd" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/fsm.vhd":1]
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [HDL 9-1654] Analyzing Verilog file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sim/testbench.v" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sim/testbench.v":1]
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [HDL 9-1061] Parsing VHDL file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/debounce.vhd" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/debounce.vhd":1]
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [IP_Flow 19-2313] Loaded Vivado IP repository '/opt/Xilinx/Vivado/2013.4/data/ip'.
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [IP_Flow 19-1704] No user IP repositories specified
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    Vivado Commands[Project 1-11] Changing the constrs_type of fileset 'constrs_1' to 'XDC'.
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    sim_1[IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [HDL 9-1654] Analyzing Verilog file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sim/testbench.v" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sim/testbench.v":1]
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [IP_Flow 19-234] Refreshing IP repositories
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [IP_Flow 19-395] Problem validating against XML schema: Invalid value format for this type spirit:order
    [IP_Flow 19-193] Failed to save BOM file '/home/jmassol/.Xil/Vivado-2683-ubuntu/coregen/dds_compiler_0/dds_compiler_0.xml'.
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [HDL 9-1061] Parsing VHDL file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/debounce.vhd" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/debounce.vhd":1]
    [IP_Flow 19-3378] Failed to create IP instance 'dds_compiler_0'. Error saving IP file.
    [IP_Flow 19-194] Failed to save IP instance 'dds_compiler_0'.
    [HDL 9-1061] Parsing VHDL file "/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/sinegen.vhd" into library work ["/home/jmassol/Desktop/Vivado/vivado_debug/ug937/project_xsim/project_xsim.srcs/sources_1/imports/ug937/sources/sinegen.vhd":1]
    set_property constrs_type XDC [current_fileset -constrset]
     

    We had the same problem when switching to Ubuntu 14.04, and there actually is a solution for it: make sure your locales are set to English.
    $> env | grep LC_*
    should only show english (or C) locales, all others are known to cause parsing errors in some numbers, usually caused by wrong string-to-float conversions (e.g. 18,29 in german is 18.29 in english). You can change the locales in the file /etc/default/localesThis is not the first time we had problems with the locale settings, Xilinx does not seem to test their software with anything else than en_US, causing obscure bugs like this one.
    HTH
    Philipp

  • Validate  XML against  XML Shema while marshalling/Unmarshalling in JAXB?.

    Hi,
    Can i validate XML documents against XML Shema when i marshall/unmarshall the same using JAXB API?.
    Thanks

    Well, it is weird, but, the code below works when validating the NonEmptyString type:
    XmlSchemaSet schemaSet = new XmlSchemaSet();
    schemaSet.Add(null, "LogConfig.xsd");
    XDocument doc1 = XDocument.Load("LogConfig.xml");
    doc1.Validate(schemaSet, new ValidationEventHandler(ValidationCallBack), false);
    However, if I leave the <LogName> empty it does not valid the values set on xsd fixed attribute, 
    The solution?
    Well, I'm validating the same xml twice, the code above and the code on my first question.

  • Validation errors weblogic-webservices.xml during deploy for valid dd

    Hi,
    I am trying to set the login-config for my JAXWS EJB webservice endpoint, but I weblogic doesn't accept my weblogic-webservices.xml
    I validated my weblogic-webservices.xml using several xml validator tools and all say it is valid.
    Here is the weblogic-webservices.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-webservices
         xmlns="http://xmlns.oracle.com/weblogic/weblogic-webservices"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
         xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-webservices http://xmlns.oracle.com/weblogic/weblogic-webservices/1.1/weblogic-webservices.xsd http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <webservice-description>
    <webservice-description-name>AppManager</webservice-description-name>
    <port-component>
    <port-component-name>AppManager</port-component-name>
    <service-endpoint-address>
    <webservice-contextpath>/AppManagerService</webservice-contextpath>
    <webservice-serviceuri>/AppManager</webservice-serviceuri>
    </service-endpoint-address>
    <login-config>
    <j2ee:auth-method>BASIC</j2ee:auth-method>
    <j2ee:realm-name>myrealm</j2ee:realm-name>
    </login-config>
    </port-component>
    </webservice-description>
    </weblogic-webservices>
    Here are the validation errors I get during deployment:
    VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected elements 'auth-method@http://java.sun.com/xml/ns/j2ee realm-name@http://java.sun.com/xml/ns/j2ee form-login-config@http://java.sun.com/xml/ns/j2ee' instead of 'auth-method@http://xmlns.oracle.com/weblogic/weblogic-webservices' here in element login-config@http://xmlns.oracle.com/weblogic/weblogic-webservices:<null> problem: cvc-complex-type.2.4a: Expected elements 'auth-method@http://java.sun.com/xml/ns/j2ee realm-name@http://java.sun.com/xml/ns/j2ee form-login-config@http://java.sun.com/xml/ns/j2ee' instead of 'realm-name@http://xmlns.oracle.com/weblogic/weblogic-webservices' here in element login-config@http://xmlns.oracle.com/weblogic/weblogic-webservices:<null>
    Error VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected elements 'auth-method@http://java.sun.com/xml/ns/j2ee realm-name@http://java.sun.com/xml/ns/j2ee form-login-config@http://java.sun.com/xml/ns/j2ee' instead of 'auth-method@http://xmlns.oracle.com/weblogic/weblogic-webservices' here in element login-config@http://xmlns.oracle.com/weblogic/weblogic-webservices:<null> problem: cvc-complex-type.2.4a: Expected elements 'auth-method@http://java.sun.com/xml/ns/j2ee realm-name@http://java.sun.com/xml/ns/j2ee form-login-config@http://java.sun.com/xml/ns/j2ee' instead of 'realm-name@http://xmlns.oracle.com/weblogic/weblogic-webservices' here in element login-config@http://xmlns.oracle.com/weblogic/weblogic-webservices:<null>
    If I remove the namespace indicator 'j2ee' it complains about the same. So it would seem that weblogic ignores the 'j2ee' resulting indeed in a invalid xml.
    Can someone please help me to a weblogic-webservices.xml (example with login-config) that was accepted by weblogic?
    Thanks a lot,
    Eltjo.

    Hi,
    Please try the following: ( Looks like you are mixing the Tag contents of web.xml  as well as weblogic-webservice.xml   together.... )
    weblogic-webservice.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-webservices xmlns="http://www.bea.com/ns/weblogic/weblogic-webservices" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-webservices http://www.bea.com/ns/weblogic/weblogic-webservices/1.0/weblogic-webservices.xsd">
          <webservice-description>
              <webservice-description-name>AppManager</webservice-description-name>
              <port-component>
              <port-component-name>AppManager</port-component-name>
                     <service-endpoint-address>
                        <webservice-contextpath>/AppManagerService</webservice-contextpath>
                        <webservice-serviceuri>/AppManager</webservice-serviceuri>
                     </service-endpoint-address>
              </port-component>
          </webservice-description>
    </weblogic-webservices>And Now provide the <login-config> information separately inside *"web.xml"* file
    <login-config>
         <auth-method>BASIC</j2ee:auth-method>
         <realm-name>myrealm</j2ee:realm-name>
    </login-config>.
    Thanks
    Jay SenSharma

  • XML instance validation against XML schema

    How can I get a reference on the error node object after
    validation against an XML schema ?
    Ex. :
    DOMParser domP = new DOMParser();
    domP.setXMLSchema(schemaDoc); // schemaDoc = ref. on an XMLSchema
    domP.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    domP.parse(reader); // reader contains the XML instance data
    If an error occurred, I only get a message string. What I need is to get a reference on the node object which contains the error in order to retrieve its properties to the schema.
    I could then alert the user with a message such as :
    "Data xxx is not valid ; it must be comprised between yy and zz...".
    Did somebody solve this problem ? May I use the XMLError class to do this ?
    Thank you

    Hi Ray,
    Were you able to resolve this issue? I am encountering a very similar problem where I am not connected to the internet and it fails during the newSchema method on javax.xml.validation.SchemaFactory. I have attempted to implement the suggestions of ExtremeGardener and vidyut with no luck.
    Per ExtremeGardener's suggestion of replacing xmlns:xs="http://www.w3.org/2001/XMLSchema" with xmlns:xs="XMLSchema.xsd" and storing it locally, it gave me an error for trying to set the "xs" or "xsd" prefixes to anything other than "http://www.w3.org/2001/XMLSchema." I forget the exact error. I also tried to use my own prefix and it did not like that either.
    Per vidyut's suggestion of using a catalog resolver, I believe that I have tried that too (if I understand correctly). I created an LSResourceResolver and tied it to the SchemaFactory. I can invoke it for a namespace but that did not resolve the issue because it only invokes the resolver on an import, include, or redefine. I believe that it is trying to reach the internet due to the xmlns:xs="http://www.w3.org/2001/XMLSchema" attribute within the top-level schema element in the XSD and I know of no way to invoke it for that.
    I also created an ErrorHandler and tied it to the SchemaFactory. That shows me the errors and they are all related to the standard XML data types defined in XMLSchema.xsd. The errors that I am seeing are all of this form: "UndeclaredPrefix: Cannot resolve 'xs:string' as a QName: the prefix 'xs' is not declared."
    I am currently using the SchemaFactory in Java 1.5, but I am thinking about trying the Xerces SchemaFactory since they are not exactly the same implementation.
    Does anyone have any other suggestions? Any help you can provide would be greatly appreciated!
    Thanks,
    betzro1

  • Validating against XML Schema

    Hi,
    does someone know how to validate a XML file against
    a XSD File (XML Schema) in ABAP. Iam using the IXML Package.
    Thanks.
    Jim

    I've originally been using Xerces1_4_0, but you're right - it's xerces-2_0_0_beta4 that does the job.
    Thanks for the hint!
    Luca

  • Oracle XML Parser validation against XML Sxhema

    Hi,
    I am developing a program in C++ on Unix, that does parsing on an XML document. For parsing I am using "Oracle XML Parser" [using DOM API]. My question is, Can Oracle XML Parser validate xml document against an XML Schema file also? I have read in many tutorials that it can validate against DTD. Please clarify my question as early as possible?
    Regards,
    Raghuram.

    Hi Kulkarni,
    I think you are trying to retrieve the text of the parent element of book. For example if this is the xml element
    <bookdetails>
    <book>Harry Potter</book>
    <author>JK Rowling</author>
    <price>34.55</price>
    </book>
    </bookdetails>
    You must be trying to retrieving the text of bookdetails.
    Check XMLNode.getNodeName() to retrieve the name of the node.
    To get 'Harry Potter' as output you need to traverse till book and then use XMLNode.getText()
    You can check the 'getQuestions()' method in Survey Sample
    to know how to tranverse to any element of an XML using Java.
    The Survey Sample is located at
    http://otn.oracle.com/sample_code/tech/xml/survey/content.html
    Download the sample and unjar it. The location of Analyser.java is
    SurveySample\code\Survey\src\oracle\otnsamples\survey\business\Analyser.java
    Have a look at it.
    Regards,
    Anupama
    http://otn.oracle.com/sample_code/content.html

  • Validating a XMLdoc against schema with multiply namespaces

    Does anybody know how to validate xmldoc against schema with multiply namespaces?
    I'd appreciate any advice on how I should perform this operation.
    I used an example from OTN "Building Server-Side XML Schema Validation" which works fine
    for single xml-xsd validation only.
    I use 8.1.7.4 oracle version with XML SDK installed.
    The error I am getting is
    0RA-29532: Java call terminated by uncaught Java exception: oracle.xml.parser.schema.XSDException: no protocol: NAME1.xsd
    ORA-06512: at sys.schemavalidation, line 0
    Here is an example of my xsd:
    <?xml version="1.0"?>
    <xs:schema
    xmlns:name1="http://.../name1"
    xmlns:name2="http://.../name2"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.1">
    <xs:import namespace="http://.../name1" schemaLocation="name1.xsd"/>
    <xs:import namespace="http://.../name2" schemaLocation="name2.xsd"/>
    <xs:element name="Header">
         <xs:complexType>
              <xs:sequence>
                   <xs:element name="ID" type="name1:IDType">
                   </xs:element>
                   <xs:element name="Code" type="name2:CodeType">
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
    </xs:element>

    In the past, ColdFusion's XML validation mechanism seems to have had issues with schemas that contain imports, e.g., http://forums.adobe.com/message/155906. Have these issues still not been resolved?
    Do you not think that perhaps you're answering your own question here?
    I don't see an issue about this on the bug tracker.  It might be an idea if you can get a simple, stand-alone repro case together and raise an issue (and post the reference back here and against that other thread so people know to vote for it).  If you post the repro case here too, it would be helpful.
    Adam

  • Xmldoc.createSchemaBasedXML validation only validates against root element?

    I'm attempting to validate an XML document against a registered schema using xmldoc.createSchemaBasedXML.
    The only time I can get the validation to fail is if the top level element is incorrect.
    Otherwise it always seems to validate OK, no matter what errors are in the file.
    This is a slimmed down version of the XML output as it should appear:
    <students>
    <student id="10257">
    <personNumber>10302</personNumber>
    </student>
    </students>
    If I pass this to xmldoc.createSchemaBasedXML it does not error, which is correct.
    If I pass this:
    <monkeys>
    <student id="10257">
    <personNumber>10302</personNumber>
    </student>
    </monkeys>
    it fails with the error:
    ORA-31043: Element 'monkeys' not globally defined in schema 'http://www.ox.ac.uk/studentDataFeed'
    This is also correct.
    However, if I pass this:
    <students>
    <rabbit id="10257">
    <personNumber>10302</personNumber>
    </rabbit>
    </students>
    or this:
    <students>
    <student id="10257">
    <hedgehogNumber>10302</hedgehogNumber>
    </student>
    </students>
    it does not return any error.
    Am I misunderstanding the type of validation that will take place when we invoke this method? Or have I possible registered my schema incorrectly.
    Thanks for any suggestions
    Ben

    Where does one lookup bugs/issues, mind that I am not an Oracle employee or customer ?
    Maybe if it's not getting adressed/fixed in the near future, people can avoid triggering this bug by knowing what causes it. I'd appreciate at least getting to the description of the problem so that I can re-format documents/schema accordingly and still be able to use XDK with schema validation capability.
    Regards,
    Amir

  • Can't validate against XML Schema take 2

    Hi,
    A few weeks ago I posted a message asking how an XML Schema file should be deployed
    in a web application. During 15 days I recived a lot of replies to questions I
    didn't ask but none to the question I asked. I recall that the XML Schema file
    is deployed with the web application in WEB-INF. I tried also WEB-INF/classes
    and WEB_INF/lib. The XML SChema file is not found. So I'm asking again: how is
    one supposed to deploy an XML Schema file in a Web application ?
    Kind regards,
    Nicolas DUMINIL

    Hi :-)
    Yes it does, in the DomHandler.java it serializes to XML then does the
    reparse with validation.
    BTW, I realized that I left out of the zip the xsd file. It is
    attached. Note also the bar.xml is using this schema from
    http://localhost
    You also have another alternative: employ a parser-specific extension to
    do the revalidation. Xerces' extension appears to be early support for
    nonfinal DOM Level 3, which supports this as part of "normalizing" a DOM
    tree. See http://xml.apache.org/xerces2-j/faq-dom.html#faq-7.
    Good luck in your continuing efforts,
    Bruce
    Nicolas DUMINIL wrote:
    >
    Bruce,
    The example you attached doesn't do any schema validation, as you seem thinking.
    In order to do schema validation, one needs at least a schema, as an XSD file.
    Or the example you provided doesn't contain any schema, at least I didn't see
    any, maybe I'm blind. The example you provided is only doing parsing and, consequently,
    it doesn't have anything to do with the problem I posted. Thank you for your time
    but honestly, don't feel obligated to just reply anything if you don't have the
    answer or you don't understand the problem.
    Kind regards,
    Nicolas DUMINIL
    Bruce Stephens <[email protected]> wrote:
    Hello,
    To obtain information from our outstanding support team you need to open
    a communication dialog using the support portal or email. The
    newsgroups are informally maintained by volunteers (typically
    development engineers), are not maintained by customer support, and
    provide no guarantee for response time or problem resolution.
    Attached is a simple web service example that does schema validation.
    See if this works OK in your environment.
    Hope this is of some value,
    Bruce
    Nicolas DUMINIL wrote:
    I went on http://support.bea.com but there is no any usefull information.
    I took
    a look in the examples you suggested and I found out that it simplydoesn't have
    anything to do with the problem I mentioned. My problem is validatingXML documents
    against an XML Schema. As I repeted at least 10 times:
    1. I know how to parse XML documents.
    2. I know how to use DTDs in validating XML documents.
    3. I also have all the information concerning the XML Schema validationand I
    know how to configure the parser for that.
    The problem I have is that my XML Schema deployed with the applicationis not
    found. It i not on the CLASSPATH, it is deployed with the applicationas any application
    component.
    Kr,
    Nicolas DUMINIL
    Bruce Stephens <[email protected]> wrote:
    Hello,
    Since this has been an ongoing issue, the best solution at this point
    may be to open a dialog with our outstanding support group:
    http://support.bea.com or [email protected]
    BTW, you also may want to take a quick look at the example provided:
    http://dev2dev.bea.com/codelibrary/code/examples_xml.jsp
    Hope this is of some value,
    Bruce
    Nicolas DUMINIL wrote:
    Hi,
    A few weeks ago I posted a message asking how an XML Schema file
    should
    be deployed
    in a web application. During 15 days I recived a lot of replies
    to
    questions I
    didn't ask but none to the question I asked. I recall that the XMLSchema file
    is deployed with the web application in WEB-INF. I tried also WEB-INF/classes
    and WEB_INF/lib. The XML SChema file is not found. So I'm asking
    again:
    how is
    one supposed to deploy an XML Schema file in a Web application ?
    Kind regards,
    Nicolas DUMINIL
    [simple.xsd]

  • Unable to validate against XML schema-URGENT!!!!

    Hi,
    I'm new to JAXP. I've been trying to validate an XML document against a Schema. But the error I get is as following:
    java Schema org.xml.sax.SAXNotRecognizedException:
    Property: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    at org.apache.crimson.parser.XMLReaderImpl.setProperty(XMLReaderImpl.java:272)
    at org.apache.crimson.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:190) at Schema.main(Schema.java:20)
    I understand that this problem is because my system is using the old default Crimson parser.
    could some one please help me out with installing and using the latest Xerces parser.
    1. I have jdk 1.4.2
    2. I have JWSDP 1.4( can the jar files there help or do I have to download the jar's from apache?)
    3. please let me know the full trouble shooting process including where should I place the jar files or how should I set the classpath.
    4. would this affect validating against a DTD(which works fine now)
    thanks in advance.
    cheers
    R43

    JAXP SAXParser produces the error
    java Schema org.xml.sax.SAXNotRecognizedException:
    Property: http://java.sun.com/xml/jaxp/properties/schemaLanguage

  • XML Schema validator fails to load XML Schema from URL

    I'm trying to validate an XML document against a set of XML Schemas and the parser seems to freak out: even though all the schemas are referred to in the XML and are properly recognized by Schemas field in XML document properties, I get warnings (multiple
    instances):
    Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
    Cannot resolve the 'schemaLocation' attribute
    The schema referenced from this location in your document contains errors
    The warning locations are also seemingly random - errors in schema locations are reported on closing tags inside XML or on whitespaces, and so on.
    The first warning (System.Net.WebPermission) suggests it has something to do with access to remote schemas, but all the necessary remote schemas are visible in XML Schema Set editor for the document. I also enabled downloading of XML schemas in XML text
    editor options.

    Hi Tomasz,
    Thank you for posting in MSDN forum.
    Since this issue is related to the XML Schemas, so we will move this case to the XML forum:https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=xmlandnetfx
    , you will get better support.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error in xml file validation to its relevant xml schema

    Hi All,
    I have 3 xml schema files files from which I generated a XML file using PLSQL.I am getting this error when I am trying to validate xml file to the schema:
    *'WMWROOT' NOT DECLARED*.Can anyone help me with this,I am including the main schema file and also the XML generated.
    XML Schem file:
    Itemdownload.xsd:
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="ItemDownload" targetNamespace="http://www.manh.com/ILSNET/Interface" elementFormDefault="qualified"
         xmlns="http://www.manh.com/ILSNET/Interface" xmlns:xs="http://www.w3.org/2001/XMLSchema" version ="2007">
         <xs:include schemaLocation="Item.xsd" />
    <xs:element name="WMWROOT" nillable="true" type="WMWROOT" />
    <xs:complexType name="WMWROOT">
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1" name="WMWDATA" type="WMWDATA" />
    </xs:sequence>
    </xs:complexType>
    <xs:element name="WMWDATA" nillable="true" type="WMWDATA"/>
    <xs:complexType name="WMWDATA">
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1" name="Items" type="ItemList" />
    </xs:sequence>
    </xs:complexType>
    <xs:element name="Items" nillable="false" type="ItemList" />
    <xs:complexType name="ItemList">
    <xs:sequence>
    <xs:element minOccurs="1" maxOccurs="unbounded" name="Item" nillable="true" type="Item" />
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    The generated xml file is:
    <?xml version="1.0" ?>
    <WMWROOT>
    <WMWDATA>
    <Items>
    <Item><Action>Save</Action><UserDef8>10074</UserDef8><Active>Y</Active><AvailableOnWeb>N</AvailableOnWeb><Company>OU: ResMed Corp</Company><Cost>285.93</Cost><Desc>HP DESKJET PRINTER (EMBLA)</Desc><HarmCode><UserDef8>10074</UserDef8></HarmCode><Item>R145-794</Item><InventoryTracking>Y</InventoryTracking><LongDesc>HP DESKJET PRINTER (EMBLA)</LongDesc><LotControlled>Y</LotControlled><SerialNumTrackOutbound>7</SerialNumTrackOutbound><StorageTemplate><Template>Each</Template></StorageTemplate><XRefs><XRef><XRefItem></XRefItem></XRef></XRefs></Item>
    <Item><Action>Save</Action><UserDef8>80862</UserDef8><Active>Y</Active><AvailableOnWeb>N</AvailableOnWeb><Company>OU: ResMed Corp</Company><Cost>54.27</Cost><Desc>Mirage Micro Mask MED&amp;LG-Internet Pkg</Desc><HarmCode><UserDef8>80862</UserDef8></HarmCode><Item>16359</Item><InventoryTracking>Y</InventoryTracking><LongDesc>Mirage Micro Mask MED&amp;LG-Internet Pkg</LongDesc><LotControlled>Y</LotControlled><SerialNumTrackOutbound>N</SerialNumTrackOutbound><StorageTemplate><Template>Each</Template></StorageTemplate><XRefs><XRef><XRefItem>619498163597</XRefItem></XRef></XRefs></Item>
    </Items>
    </WMWDATA>
    </WMWROOT>
    I can provide you with the other 2 dependent schemas if needed.Please reply me!!

    Hey,
    As you said I tried keeping the namespace in xml file and it worked for a strange reason I am getting the same error again,I am not able to figure it why!!
    The error is:
    SAMPLEITEMDLFILE.xml:2,139: no declaration found for element 'WMWROOT'
    The XML document SAMPLEITEMDLFILE.xml is NOT valid (1 errors)
    This is the part of PL/SQL code thru which I am generating the xml:
    UTL_FILE.put_line (l_out_file, '<?xml version="1.0" ?>');
    UTL_FILE.put_line (l_out_file, '<WMWROOT');
    UTL_FILE.put_line (l_out_file, 'xmlns="http://www.manh.com/ILSNET/Interface"> ');
    UTL_FILE.put_line (l_out_file, '<WMWDATA>');
    UTL_FILE.put_line (l_out_file, '<Items>');
    I am validating it in stylus studio tool.
    Can you please help me thru this?

  • XML Validation with Sun Multischema XML Validator

    Dear readers,
    I am able to parse an XML file and validate it with a W3C-schema.
    But has anyone ever tried and succeeded in validating a part of an XML file or DOMDocument? It should go with the Sun MultiSchema Validator.
    Available @ http://wwws.sun.com/software/xml/developers/multischema/
    If anyone has a nice working example for validating a part of an XML-file it would certainly come in handy!
    I think it has something to do with that Acceptor interface...
    Any help is welcome.
    Regards
    Bram

    Solved the problem myself...
    Dukedollars are removed.
    You can use Sun multischema validator in combination with dom4j and
    manipulate your XML doc in memory. And also validate on Node level!

  • Validation rule for/against intercompany reporting

    Hi,
    I need a validation rule which checks that a cons unit does not report intercompany against itself.
    Validation should be on individual data records.
    Have checked various options, no success so far.
    Have you got any hints? thx, Clemens

    The only standard validation I can imagine for this is to include each cons unit as a check to ensure the same value is not used for trading partner. This will be an expensive validation is there are many cons units.
    Another idea is to use a custom task with code to check this.
    Another idea is to include a check for this in the update rules as part of the initial data extraction (if using load from data stream).

Maybe you are looking for

  • DBCA can not use ASM for database storage due to following reason: Could no

    Hi I've a recently installed RAC11gR2(11.2.0.3) on HP-UX I installed Grid Infrastructure with grid user: Node1: # id grid uid=1100(grid) gid=1000(oinstall) groups=1031(dba),1021(asmdba) Node2: # id grid uid=1100(grid) gid=1000(oinstall) groups=1031(d

  • Itunes and quicktime do not work

    When i open itunes, there is a message saying that error has occured, and itunes must be closed, but no error number has shown. When I visit website with quicktime, a message says that an error ocurred inside a plugin inside the page. I did an update

  • How to load epub on 2 nooks

    .HAVE 2 NOOKS ONE COLOR ONE B&W COLOR WORKS FINE BUT B&W DOWNLOADS LIBRARY  BOOK BUT UNABLE TO AUTHORIZE  IT.ERROR M   ESSAGE ROUTER NOT AVAILABLE TRY LATER. IS THIS DUE TO BOTH NOOKS HAVING THE SAME E MAIL ADDRESS OR SOME OTHER REASON?

  • FI table for Report painter

    Which table I will take to create FI report in Report Painter ? Please help me.. Thanks & Regards, Ananda

  • MacBook Pro late 2013 not charging

    Hello guys! Well, I'm having a problem with my laptop. (MacBook Pro late 2013, 15" 2.3 GHz, 16 GB ram etc) Today, my battery went down to 3% and I connected it to its charger but it does not do anything. No light at all and of course no charging. As