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.

Similar Messages

  • 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?

  • 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 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

  • 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 with XSD in java mapping

    Hi experts,
    I have created an interface to send differents messages between bussines system, the bussiness system receiver is put in the message, to get this value I have a configuration file indicating the path of this field for each message type. In a java mapping I transform the message sent in this structure:
    <document>
    <message>HERE THE MESSAGE AS STRING</message>
    <parameters>
    <sender>HERE SENDER BUSSINESS SYSTEM</sender>
    <receiver>HERE RECEIVER BUSSINESS SYSTEM</receiver>
    </parameters>
    </document>
    the messaging interface works fine, but now I have to validate the XML vs XSD. I need doing in a java mapping because the messaging interface send the message and a email to sender in error case.
    To do this validation I have implemented two java mappings that works fine in my local, the first way is with class Validator of java 5, but my system PI 7.1 return an error with this class. The second way is with SAX parse:
    String schema = "XXXXXxsd";
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    docBuilderFactory.setNamespaceAware(true);
    docBuilderFactory.setValidating(true);
    docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema");
    InputStream is = this.getClass().getClassLoader().getResourceAsStream(schema);
    docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",is);
    in my local works fine but in PI always return OK never fail.
    For this moment the schema is hardcoded to do proofs, in the future will be loaded from my configuration file.
    Any idea?
    Thanks in advance
    Jose

    hi Jose,
    PI 7.1 has a built in feature available called XML vaidations ..
    your source xml can be validated against a XSD placed at a specific location on the PI server..
    validation can be performed at adapter/integration engine
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d06dff94-9913-2b10-6f82-9717d9f83df1?quicklink=index&overridelayout=true

  • 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

  • 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.

  • 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

  • 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

  • Check XML file against XSD? Via XSLT?

    Hello,
    we´re using a 6.20 system (XI not available) and want to check XML files against a XML-schema definition file (xsd).
    Is there a function in 6.20 available for this? Is it possible to use "CALL TRANSFORMATION" for it? I´ve seen other XSLT parser in the internet which are able to check a source XML against an XSD before transforming it to the result XML.
    But is this possible with an 6.20 system?
    Thank you for your help,
    best regards,
    Stefan

    Here is the sample XML and the schema.
    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <book isbn="0836217462">
    <title>
      Being a Dog Is a Full-Time Job
    </title>
    <author>Charles M. Schulz</author>
    <character>
      <name>Snoopy</name>
      <friend-of>Peppermint Patty</friend-of>
      <since>1950-10-04</since>
      <qualification>
        extroverted beagle
      </qualification>
    </character>
    <character>
      <name>Peppermint Patty</name>
      <since>1966-08-22</since>
      <qualification>bold, brash and tomboyish</qualification>
    </character>
    </book>
    XSD:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="book">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="title" type="xs:string"/>
            <xs:element name="author" type="xs:string"/>
            <xs:element name="character" minOccurs="0" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="name" type="xs:string"/>
                  <xs:element name="friend-of" type="xs:string" minOccurs="0"
                          maxOccurs="unbounded"/>
                  <xs:element name="since" type="xs:date"/>
                  <xs:element name="qualification" type="xs:string"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="isbn" type="xs:string"/>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    - Suman

  • Get errors of a xml validation from xsd file

    hi everyone,
    i created a xml validation from a XSD file as follow:
    public String validate(String xml) {
            String saida = "";
            InputStream xsd = XmlValidator.class.getResourceAsStream("shiporder.xsd");       
            try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                docBuilderFactory.setNamespaceAware(true);
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes());
                Document doc = docBuilder.parse(is);
                SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                Source schemaFile = new StreamSource(xsd);
                Schema newSchema = (Schema) factory.newSchema(schemaFile);
                Validator validator = newSchema.newValidator();
                validator.validate(new DOMSource(doc));           
                saida = "SUCESSO";
            } catch (DOMException ex) {           
                ex.printStackTrace();
                saida =  "DOM";
            } catch (SAXException ex) {           
                saida = ex.getMessage();
            } catch (IOException ex) {           
                ex.printStackTrace();
                saida =  "IO";
            } catch (ParserConfigurationException ex) {           
                ex.printStackTrace();
                saida = "PARSER_CONFIGURATION";
            return saida;
        }this code works perfectly, but i must change one thing.
    When is found a error on a xml structure, one exception is threw, and then the method is finalized. However i need to show up all errors on one shot.
    Because right now when i run and it find a error, the method throw an exception an stop, so i have to adjust, then execute again and adjust another repeatedly until everything is right, so i have to change that.
    Anyone could help me?
    thanks in advance

    That's the rule for XML validation. As soon as the parser finds an error, it must report it and stop.
    If you are having a lot of trouble creating an XML document which conforms to a schema, perhaps you should invest in one of those XML editors which supports validation as you enter the document.

  • XML validating with XSD

    Please clarify the following
    1) To validate a XML output with a XSD is it necessary to register the xsd in the database?.
    2) I tried running the below give command to register the .xsd file. It errored out with the below message. Do we need to some additional installation for having dbms_xmlschema in oracle database or am I missing something. My ver of oracle is 9.2.0.6.0.
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'DBMS_XMLSCHEMA.REGISTERSCHEMA' must be declared
    BEGIN
    DBMS_XMLSchema.registerSchema(
    schemaurl=>'http://ifsddev.na.abc.com/home/vick/105564/batchuserimport.xsd',
    schemadoc=>sys.UriFactory.getUri('/home/vick/105564/batchuserimport.xsd'));
    END;

    1) You could validate XML files against an XSD by using standard Java, PL/SQL, etc. functionality. Just to validate XML you do not need to register the schema in XDB. See e.g. http://www.oracle.com/technology/pub/articles/vohra_xmlschema.html
    2) Also see: DBMS_XMLSCHEMA.REGISTERSCHEMA' must be declared to know whether XML DB has been installed/configured.
    Regards, Ronald

  • 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 registered XSD

    I have registered XSD into oracle database, while validating xml against this xsd I got stuck with non-mandatory tags.
    Below is the tag-XSD structure:
    Status field as String:
    <xs:element name="Status" nillable="false"> <xs:annotation> <xs:documentation>Values are 'N' or 'E'</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="1"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    idnumber tag field as Integer:
    <xs:element name="idnumber" type="xs:int" nillable="false">
    <xs:annotation>
    <xs:documentation>id value </xs:documentation>
    </xs:annotation>
    </xs:element>
    As status tag is of string type and I have mentioned it as nillable = "False", but even though when I am passing this tag as <status/>, then also its validating xml.... but as i mentioned nillable property as false then it should not validate it ..... please correct me if i m wrong..
    In case of idnumber tag it is of int type. In this case <idnumber/> will not work in either case even it is nillable = true or false. Means we cannt pass null values in integer field..... right?
    Please suggest me how to make tag of string datatype as not nillable.
    Is there any significance of using nillable = "false" in int datatype tag. Means if we want to make it as optional then need to mention it as minoccurs = 0..... is it correct?
    Requirement is simple:
    Just want to make some tag as optional and some as mandatory, tag can be of integer or string type.
    Thanks in advance.....
    Edited by: 959352 on 15-Oct-2012 00:45

    As status tag is of string type and I have mentioned it as nillable = "False", but even though when I am passing this tag as <status/>, then also its validating xml.... but as i mentioned nillable property as false then it should not validate it ..... please correct me if i m wrong.. The nillable attribute doesn't work that way. It's easy to look that up in any tutorial.
    nillable = "true" means you allow the element to have a NULL content (different from empty string) by specifying an explicit null attribute :
    <Status xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>nillable = "false" is the default behaviour.
    Please suggest me how to make tag of string datatype as not nillable.
    Is there any significance of using nillable = "false" in int datatype tag. Means if we want to make it as optional then need to mention it as minoccurs = 0..... is it correct?
    Requirement is simple:
    Just want to make some tag as optional and some as mandatory, tag can be of integer or string type. You have to be careful about the vocabulary.
    In my mind, an "optional" element means you can omit it entirely in the instance document (minOccurs="0"), whereas an empty element means the start tag and end tag are there but with no content.
    There are multiple ways to allow for empty or non-empty elements.
    e.g. for a non-empty string :
    <xs:minLength value="1"/>or, as in your example, if the content is actually constrained to a list of values, use enumerations.
    xs:int datatype doesn't allow empty values (unless you use xsi:nil).
    A possible solution is to build a new type by unioning (xs:union) an xs:int and an empty string type.

Maybe you are looking for

  • Crystal didn't show the BEx query Attributes description changes/Values

    We experiencing the BEx query attributes/crystal report  issue. I create a crystal report using BW- BEx query. Bex query displays the attributes values. But in crystal report side it didn;t show up the values as well as description changes. But If I

  • How can I re-create the Win 8 system after getting a new HD

    Hi, I plan to buy a T530(with small HD 320GB) with Win 8 PreInstalled from Levnovo, and then buy a bigger 1TB HD to replace the original 320GB. Is there anyway to still use the original license of Win 8 that comes with my purchase to re-create the sy

  • Camera raw not working after recent update

    I updated my creative cloud apps last week.  Now when I try to open a raw image, photoshop opens then crashes before camera raw can open?  I have also tried to open images from bridge and it does the same thing? I have uninstalled and reinstalled bot

  • Apple releases Digital Camera RAW Support Update

    -Canon Digital Rebel XTi / 400D / Kiss X Digital -Nikon D80 -Pentax *ist DS Other issues addressed: -Handling of large Canon RAW files (.CRW) -DNG compatibility on Intel-based Macs -Lines sometimes appearing in images exported from Aperture Now all m

  • ANN: New JSP 2.0 Demos on OTN

    New JSP 2.0 Demos These demos illustrate a range of JSP features in Oracle Application Server Containers for J2EE 10g (OC4J), including fragments, simple tag handlers, tag files, JSTL, and EL(Expression Language). JSP 2.0 Tic-Tac-Toe Demo illustrates