Problem in xml validation against schema

this is the xml file
<?xml version="1.0" encoding="UTF-8"?><hello xmlns=""><Capabilities xmlns=""><capability xmlns="">base</capability><capability xmlns="">writablerunning</capability><capability xmlns="">null</capability><username xmlns="">netconf</username><password xmlns="">netconf</password></Capabilities></hello>
xsd file is
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:com.tel.netconf.server"
xmlns="urn:com.tel.netconf.server"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="hello" type="helloType"/>
<xs:element name="username" type="xs:string"/>
<xs:element name="password" type="xs:string"/>
<xs:element name="Capabilities" type="capabilitiesinfo"/>
<xs:complexType name="capabilitiesinfo">
<xs:sequence>
<xs:element name="capability" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="username"/>
<xs:element ref="password"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="helloType>
<xs:sequence>
<xs:element ref="Capabilities"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
error msg is
Error: Document is invalid: no grammar found.
at line 2, column 7
in entity file:///D:/NETCONF/axis-src-1_4/axis/netconf/com/tel/netconf/server/h
ello1.xml
Error: Document root element "hello", must match DOCTYPE root "null".
at line 2, column 7 in entity file:///D:/NETCONF/axis-src-1_4/axis/netconf/com/tel/netconf/server/h
ello1.xml
org.xml.sax.SAXParseException: The value of attribute "name" associated with an
element type "xs:complexType" must not contain the '<' character.
plz kindly help me out

Hi Madhura,
see here my comparison of the web version against the local file version on my Windows box (which is itself not the fastest): It makes a factor 16 in difference!
C:\Temp\xsdvalidator>java XsdValidator madhu.xsd madhu.xml
cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
NOK - Validation error
Elapsed time: 16353 ms
C:\Temp\xsdvalidator>java XsdValidator madhu_local.xsd madhu.xml
cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
NOK - Validation error
Elapsed time: 994 ms
Obviously, the w3c.org domain that you specified as ressource location is very slow - and, as the FAQ shows, this delay is intentional!
The W3C servers are slow to return DTDs. Is the delay intentional?
Yes. Due to various software systems downloading DTDs from our site millions of times a day (despite the caching directives of our servers), we have started to serve DTDs and schema (DTD, XSD, ENT, MOD, etc.) from our site with an artificial delay. Our goals in doing so are to bring more attention to our ongoing issues with excessive DTD traffic, and to protect the stability and response time of the rest of our site. We recommend HTTP caching or catalog files to improve performance.
--> They don't want to have requests to their site from productive servers all around the world.
Regards,
Rüdiger

Similar Messages

  • XML validation against schema in XSD format

    I have a requirement for validation of XML file against XML schema(XSD format). Using IXML liabrary I know how to validate XML file against schema in DTD format. But i am not getting how to do it against XSD. Is it possible using IXML liabrary? Also i wanted to know how to attach one XML or CSV file into another XML file using SAP ABAP.
    Please provide solution!!

    Hi Madhura,
    see here my comparison of the web version against the local file version on my Windows box (which is itself not the fastest): It makes a factor 16 in difference!
    C:\Temp\xsdvalidator>java XsdValidator madhu.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 16353 ms
    C:\Temp\xsdvalidator>java XsdValidator madhu_local.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 994 ms
    Obviously, the w3c.org domain that you specified as ressource location is very slow - and, as the FAQ shows, this delay is intentional!
    The W3C servers are slow to return DTDs. Is the delay intentional?
    Yes. Due to various software systems downloading DTDs from our site millions of times a day (despite the caching directives of our servers), we have started to serve DTDs and schema (DTD, XSD, ENT, MOD, etc.) from our site with an artificial delay. Our goals in doing so are to bring more attention to our ongoing issues with excessive DTD traffic, and to protect the stability and response time of the rest of our site. We recommend HTTP caching or catalog files to improve performance.
    --> They don't want to have requests to their site from productive servers all around the world.
    Regards,
    Rüdiger

  • XML validation against Schema

    Hi,
    We have SAP WebAS 6.20. Can someone help me understand how I can validate XML document against schema in ABAP.
    Thanks,
    Suman

    hi
    u can check the below links
    XML schema in ABAP
    Can i use XSD / XML in Abap Programs
    Regards,
    Naveen

  • Question about XML validation against schema

    My question is probably a basic one about XML. I tried PurchaseOrder example from the book "J2EE Web Services" by Richard Monson-Haefel. A simplified version as followings -
    Address.xsd -
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xml.netbeans.org/schema/Address"
    xmlns:addr="http://xml.netbeans.org/schema/Address"
    elementFormDefault="qualified">
    <element name="address" type="addr:USAddress" />
    <complexType name="USAddress">
    <sequence>
    <element name="name" type="string" />
    <element name="street" type="string" />
    <element name="city" type="string" />
    <element name="state" type="string" />
    <element name="zip" type="string" />
    </sequence>
    </complexType>
    </schema>
    PurchaseOrder.xsd -
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xml.netbeans.org/schema/PurchaseOrder"
    xmlns:po="http://xml.netbeans.org/schema/PurchaseOrder"
    xmlns:ad="http://xml.netbeans.org/schema/Address"
    elementFormDefault="qualified">
    <import namespace="http://xml.netbeans.org/schema/Address" schemaLocation="Address.xsd" />
    <element name="purchaseOrder" type="po:PurchaseOrder" />
    <complexType name="PurchaseOrder">
    <sequence>
    <element name="accountName" type="string" />
    <element name="accountNumber" type="unsignedShort" />
    <element name="shipAddress" type="ad:USAddress" />
    <element name="total" type="float" />
    </sequence>
    <attribute name="orderDate" type="date" />
    </complexType>
    </schema>
    Then PurchaseOrder.xml is -
    <purchaseOrder orderDate="2007-12-12"
    xmlns='http://xml.netbeans.org/schema/PurchaseOrder'
    xmlns:addr="http://xml.netbeans.org/schema/Address"
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xsi:schemaLocation='http://xml.netbeans.org/schema/PurchaseOrder ../xsd/PurchaseOrder.xsd'>
    <accountName>Starwood</accountName>
    <accountNumber>220</accountNumber>
    <shipAddress>
    <name>Data Center</name>
    <street>1501 Washington St.</street>
    <city>Braintree</city>
    <state>MA</state>
    <zip>02148</zip>
    </shipAddress>
    <total>250</total>
    </purchaseOrder>
    Then I did a XML validation but have this error -
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'name'. One of '{"http://xml.netbeans.org/schema/Address":name}' is expected. [19]
    It complains <name> tag in <shipAddrss> needs namespace of "http://xml.netbeans.org/schema/Address". Why?
    Is it possible to change XML so it does not need name space for elements inside <shipAddress>?
    Thanks

    Hi Madhura,
    see here my comparison of the web version against the local file version on my Windows box (which is itself not the fastest): It makes a factor 16 in difference!
    C:\Temp\xsdvalidator>java XsdValidator madhu.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 16353 ms
    C:\Temp\xsdvalidator>java XsdValidator madhu_local.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 994 ms
    Obviously, the w3c.org domain that you specified as ressource location is very slow - and, as the FAQ shows, this delay is intentional!
    The W3C servers are slow to return DTDs. Is the delay intentional?
    Yes. Due to various software systems downloading DTDs from our site millions of times a day (despite the caching directives of our servers), we have started to serve DTDs and schema (DTD, XSD, ENT, MOD, etc.) from our site with an artificial delay. Our goals in doing so are to bring more attention to our ongoing issues with excessive DTD traffic, and to protect the stability and response time of the rest of our site. We recommend HTTP caching or catalog files to improve performance.
    --> They don't want to have requests to their site from productive servers all around the world.
    Regards,
    Rüdiger

  • XML validation against schema (NOT DTD)

    Hi,
    I am fairly new at parsing XML documents, but I am trying to parse
    an XML document using the Xerces SAXParser.
    I can parse my xml document, no problems there, but I want to validate
    it against an xml schema file, without specifying the file in the xml document.
    How can I do this? If I set validating to true, it gives me errors about a DTD,
    but I don't have a DTD, I want to use a schema file.
    Can anybody help me, or give me a code example?
    THanks,
    Sven

    SAXParser parser = new SAXParser();
                 parser.setFeature("http://xml.org/sax/features/validation",
                          true);
                 parser.setFeature("http://apache.org/xml/features/validation/schema",
                          true);
                 parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",
                          true);

  • XML validation against XSD

    Hi,
    Does Oracle 8i (Release 3) support XML validations against XSD? I know Oracle 9i (Release 2) supports XML validations against XSD.
    Also, Does Oracle support XML validations against XDR?
    Any info is appreciated.
    Thanks
    Pavan

    Validate with DOMParser or the SAXParser.

  • Validating xml input against schema's registered in database

    Hi,
    We have an application that stores a massive XSD document (with cyclical references between schemas) in a VARCHAR2 column of a table. The XSD is loaded everytime an xml input needs to be parsed. The problem is that the XSD is very huge, and maintaining it is going to be a problem as it continues to grow. I don't beleieve this is the most efficient way of doing this.
    What I would like to do is to register each of the schemas that are part of the large XSD and use the <include schemaLocation/> directive. I have seen tutorials for doing this. Example tutorial at this link:
    http://www.cs.utah.edu/classes/cs5530/oracle/doc/B10501_01/appdev.920/a96620/xdb05obj.htm
    My sole purpose for registering the XSD's is to validate any xml input that is passed in as input to my Java program that is running in the database; I don't want to store the input xml in a table. If the input is successfully validated, my program will continue processing.
    I have seen some Java OTN tutorials which have methods with 2 parameters - xml, and xsd. I want to avoid this approach because in my case, the XSD would already be registered in the database.
    Any tips would be very much appreciated.
    Cheers,
    Rudi

    AN XML Document may be validated with schema registered in database.
    http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10790/xdb08tra.htm#sthref843

  • In-memonry xml document validation against schema with xerces

    Hello, there.
    I found that I can't use JAXP's javax.xml.validation package with jdk 1.4. (Am I wrong?)
    Anyway,
    I found that I can use xerces's DOMParser for the same purpose.
    But I can't find the way to validate my programmatically generate org.w3c.dom.Document against existing schema file.
    Can anybody help me?
    Thanks.

    Have you read Xerces documentation or SUN xml API, there is always a parser option (I suppose it's in the standard) to validate input while parsing.
    Look the API : http://java.sun.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#setValidating(boolean)

  • QUESTION: XML validation against a schema - for beginners

    Hi folks,
    i am new to XML validation.
    i would like to find out how to validate an XML file using a schema given to me by a third part company.
    the business process requires that our company sends a weekly file which complies with their schema.
    in real-life, i am expecting some details of our file to fail against their schema.
    thus i would like to find a way validating the file localy before sending it to this third part.
    this validation would ideally allow me to highlight and identify which records are failing the validation, and enable me to strip those and send only those that are successfully checked.
    on the example below, i would expect to have the record for John Smith to be successful (country has an integer); while Queen Victoria would fail as it uses UK instead of an integer to identify the country.
    thus i would need to find a way validating this XML file, move the record of Queen Victoria to another file to be fixed and to allow, the record for John Smith to be sent out.
    if you guys could post some links to where i can find further information on this type of processing, i would be most grateful.
    Many thanks,
    Nicolas
    using an example from:
    [http://www.codeguru.com/csharp/csharp/cs_data/xml/article.php/c6737]
    XSD
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="address">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="name" type="xs:string"/>
    <xs:element name="street" type="xs:string"/>
    <xs:element name="city"type="xs:string"/>
    *<xs:element name="country"type="xs:integer"/>*
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>XML
    <address>
    <name>John Smith</name>
    <street>109 Abbey Close</street>
    <city>Hayes</city>
    <country>98</country>
    </address>
    <address>
    <name>Queen Victoria</name>
    <street>1 Regent Street</street>
    <city>London</city>
    <country>UK</country>
    </address>Edited by: www.jegue.net on Jan 13, 2009 9:48 AM
    Edited by: www.jegue.net on Jan 13, 2009 9:49 AM

    i would need to find a way validating this XML file, move the record of Queen Victoria to another file to be fixed and to allow, the record for John Smith to be sent out.I don't think any automated tool or API available with such features. You should achieve this by some tricky logic/code.

  • Using XSL on XML validated against XSD

    Transforming XSD validated XMLType Data
    Re: example XSL in Chapter 6 that transforms XML with associated XSD schema definition (Oracle 9i XML Database Developer's Guide)
    I noted that this XSL uses only the "general" node identification functions (e.g., name() ) to access nodes in the <xsl:value-of select..>. I have also noted that standard XSL templates from other sections of the documentation, for example in Chapter 3 and in Appendix D, do not work with an XML which is validated against an XSD schema.
    Can anyone give me an example <xsl:value-of select..> that addresses a specific node in the "purchase order" example, like the shipTo, name, street -- or any other specific node. This is critical since there is always bound to be node-specific processing in any transformation, and this is not demonstrated by any example of XML which has been validated against an XSD.
    I have tried this endlessly on my own examples of XML w/XSD validation. Even if the value-of select="name(.)" tells you that the name of the node is "FooBar", you cannot use FooBar as a select test to do FooBar specific processing.
    Help?????

    Not quite understand your question. Can you send me the example doc?

  • XML validation against DTD.. Is it possible?

    Hello all,
    Sorry for what may be a trivial post, but I'll keep it short..
    According to the docs:
    "The Validate XML command will validate the XML against the schema defined in the XML file. This command on the context menu is disabled whenever an XML file does not have an XML namespace defined."
    I'm used to the XML editor retrieving a DTD from somewhere and validating it against that.. is it possible to do this in JDev?

    Unfortunately it's not. We only have support for validating against XML Schemas.
    Rob

  • XSL used on XML validated against XSD

    Transforming XSD validated XMLType Data
    Re: example XSL in Chapter 6 that transforms XML with associated XSD schema definition (Oracle 9i XML Database Developer's Guide)
    I noted that this XSL uses only the "general" node identification functions (e.g., name() ) to access nodes in the <xsl:value-of select..>. I have also noted that standard XSL templates from other sections of the documentation, for example in Chapter 3 and in Appendix D, do not work with an XML which is validated against an XSD schema.
    Can anyone give me an example <xsl:value-of select..> that addresses a specific node in the "purchase order" example, like the shipTo, name, street -- or any other specific node. This is critical since there is always bound to be node-specific processing in any transformation, and this is not demonstrated by any example of XML which has been validated against an XSD.
    I have tried this endlessly on my own examples of XML w/XSD validation. Even if the value-of select="name(.)" tells you that the name of the node is "FooBar", you cannot use FooBar as a select test to do FooBar specific processing.
    Help?????

    Not quite understand your question. Can you send me the example doc?

  • XML validation against DTD

    Hi,
    I have an application that receives XML from an external source. The XML received does not have the XML version and the doc type declaration lines. I want to validate the XML against a DTD.
    One dirty way of doing this is to open the XML received and prepend the XML versions and doctype lines to it. And then parse the XML. But is it the right way to do it?
    What I would like to know is that does the XML parser provide any API which can tell it to validate an XML document against a certain DTD.

    Yes, there is an API to do this. You have to do something like this:
    DocumentBuilderFactory dbf          =DocumentBuilderFactory.newInstance();
    dbf.setValidating(true);
    DocumentBuilder db = dbf.newDocumentBuilder();
    XMLErrors eh = new XMLErrors(frame);
    db.setErrorHandler(eh);
    Document doc = db.parse(f);
    (where f is the XML file)
    In this example, the class XMLErrors is used as the ErrorHandler. XMLErrors extends the DefaultHandler class and provides the user with information about the various error levels. A call to the over-ridden "error" method notifies the user (using a Dialog box) that the document doesn't meet the DTD.
    Hope this helps.

  • XML validation against XSD Schema in ABAP

    Hi colleagues,
    I'm looking for a way to validate a XML against a XSD schema in ABAP, without using java or command line or something like that. Is there any way to do this only with ABAP?
    Thanks in advance.
    Regards,
    Guenter

    Hi everyone,
    I'm currently facing the same problem. I need to validate a xml file with an existing xsd schema for some export/import functionality. I just found an ABAP program doing this with a Java fallback. But isn't there a way doing this wihtout using Java but only ABAP? There certainly is, anyone an idea?
    Thank you and regards
    Maximilian

  • Validation against schema problem

    Having a problem validating a sample instance of my schema using the schemaValidate() API, in fact the sample app xsdtest fails as well.
    xsdtest reports:
    In line 8 of sample.xml:
    LSX-00204: extra data at end of complex element
    Validation failed, error 204
    --- sample.xml ---
    <?xml version="1.0" encoding="UTF-8"?>
    <XMLConfig
              xmlns="http://www.foo.com/Config"
              xmlns:cfg="http://www.foo.com/Config"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="xmlconfig.xsd">
         <!--<xsd:include schemaLocation=""/>-->
         <hostname>localhost</hostname>
         <server>
              <IPv4>127.0.0.1</IPv4>
         </server>               
    </XMLConfig>
    Line 8: contains a comment, why a failure ? In fact having any element from the schema placed there causes this error, the only time the sample instance was valid is having nothing between <XMLConfig></XMLConfig>.
    XMLSpy validates the document fine so either them or XDK have a parser problem. Any help appreciated, thanks.
    ---xmlconfig.xsd---
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Namespace definitions -->
    <xs:schema
                        targetNamespace="http://www.foo.com/Config"
                        xmlns:cfg="http://www.foo.com/Config"
                        xmlns:xs="http://www.w3.org/2001/XMLSchema"
                        elementFormDefault="qualified"
                        attributeFormDefault="unqualified"
                        version="1.0">
         <xs:element name="XMLConfig">
              <xs:annotation>
                   <xs:documentation xml:lang="en">XML Based Configuration</xs:documentation>
              </xs:annotation>
              <xs:complexType mixed="true">          
                   <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <!-- cfg elements -->
                        <xs:element name="filePath"           type="cfg:filePath"/>
                        <xs:element name="hostname"           type="cfg:hostname"/>
                        <xs:element name="IPv4"           type="cfg:IPv4"/>                    
                        <xs:element name="server"          type="cfg:server"/>
                   </xs:choice>
              </xs:complexType>
         </xs:element>
         <!-- File Path (Windows/Unix) -->
         <xs:simpleType name="filePath">
              <xs:annotation>
                   <xs:documentation xml:lang="en">
                        System file path
                   </xs:documentation>
              </xs:annotation>
              <xs:restriction base="xs:anyURI">
                   <xs:minLength value="1"/>
                   <xs:maxLength value="16384"/>
              </xs:restriction>
         </xs:simpleType>
         <!-- IPv4 address (RFC791) -->
         <xs:simpleType name="IPv4">
              <xs:annotation>
                   <xs:documentation xml:lang="en">
                   Internet Protocol V4 (IPv4) address
                   </xs:documentation>
              </xs:annotation>
              <xs:restriction base="xs:string">
                   <xs:minLength value="1"/>
                   <xs:maxLength value="15"/>
                   <xs:pattern value="((([01]?\d\d?|2[0-4]\d|25[0-5])\.){3,5}([01]?\d\d?|2[0-4]
                                                           \d|25[0-5]))"/>
              </xs:restriction>
         </xs:simpleType>
         <!-- Hostname (RFC952) -->
         <xs:simpleType name="hostname">
              <xs:annotation>
                   <xs:documentation xml:lang="en">
                   Machine hostname constructed using RFC952 rules.
                   </xs:documentation>
              </xs:annotation>
              <xs:restriction base="xs:string">
                   <xs:minLength value="1"/>
                   <xs:maxLength value="255"/>
                   <xs:pattern value="([a-zA-Z][a-zA-Z0-9\-\.]*[a-zA-Z0-9])"/>
              </xs:restriction>
         </xs:simpleType>
         <!-- Server type (Hostname or IP Address) -->
         <xs:complexType name="server">
              <xs:annotation>
                   <xs:documentation xml:lang="en">
                   Hostname or IPAddress
                   </xs:documentation>
              </xs:annotation>               
              <xs:choice>
                   <xs:element name="hostname"      type="cfg:hostname"/>
                   <xs:element name="IPv4"      type="cfg:IPv4"/>
              </xs:choice>                    
         </xs:complexType>
    </xs:schema>

    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

Maybe you are looking for

  • APPs from iPhone 3gs to iPad 2

    can my apps from my iPhone 3gs be used on the iPad 2?

  • How many Accounts we can clear By using F.13 And F-03

    HI All, I want to clear all open accounts using F.13 or F-03 But some gl are not getting square off except GR/IR Account. How can i Clear Ecess clearing, Fright clearing Service tax Clearing....Accounts. I am unable to clear this accounts please give

  • Problem with digital signatures in Acrobat 8

    Is it true that the ability to directly create a digital signature field is available in Acrobat 7 & 9 but not in 8? I have Acrobat Standard 8.0.0 and want to create blank signature fields before I certify a document, but can't find a way to do this

  • BPEL DB Adapter issue

    i have the following issue with the db adapter in BPEL designer JDeveloper 10.1.2.0.2 I'm trying to read records from an gupta sqlbase database. I'm getting to the import tables wizard screen and i can select the table i want to query. However when i

  • F-53 Outgoing Payment Post

    Hello I did a transaction in F-53 which is outgoing payment post.  How do I print the check after doing that transaction?  I checked in SP02 and it was not in there.  I tried FBZ5 still nothing happened.  Please Help. Monika