Does XDB supports validating xml against multiple schemas?

The XMLType has some methods for validating an xml documents against a schema, e.g., SCHEMAVALIDATE, etc.. does XDB support validating xml against multiple schemas (Just like what JAXP or Xerces have done)? Or what's the current situation about this issue? thanks.

did you try using the import schema element instead of the include elemnt?

Similar Messages

  • Error while Validating xml against a schema using jaxp

    Hi All,
    Following code validates xml against a schema using JAXP .It gives SAXNotRecognizedException error when you run the program.
    static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
    SAXParserFactory myFactory = SAXParserFactory.newInstance();
    myFactory.setNamespaceAware(true);
    myFactory.setValidating(true);
    javax.xml.parsers.SAXParser parser;
    String filename = "C:/Note.xml";
    File xmlFile = new File(filename);
    try
         DefaultHandler handler = new DefaultHandler();
         parser = myFactory.newSAXParser();
         parser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
         parser.parse(xmlFile, handler);
    catch (ParserConfigurationException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    catch (SAXException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    catch (IOException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    Error Details :
    org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
         at org.apache.xerces.framework.XMLParser.setProperty(XMLParser.java:1682)
         at org.apache.xerces.parsers.SAXParser.setProperty(SAXParser.java:770)
         at org.apache.xerces.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:183)
    How do i fix the above mentioned problem ?
    Thanks in Advance.
    Ansh

    Validate with the JAXP DOMParser instead of the JAXP SAXParser.
    To validate with a SAXParser use the xerces SAXParser.
    thanks,
    Deepak

  • Issue in Store XML into Schema generated tables and Validation XML against registered schema.

    Hello friends,
    I am facing some problem when store xml into generated tables from registered schema.
    This is my Schema
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.abc.inf.in/test" targetNamespace="http://www.abc.inf.in/test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="abc.xsd"/>
      <xs:element name="project" type="student">
      <xs:annotation>
      <xs:documentation> This is a Documentation</xs:documentation>
      </xs:annotation>
      </xs:element>
    </xs:schema>
    -- This is my xml document
    <project versao="2.00" xmlns="http://www.abc.inf.in/test">
      <test xmlns="http://www.abc.inf.in/test">
      <intest version="2.00" Id="testabc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  >
      <ide>
      <cUF>35</cUF>
      <cNF>59386422</cNF>
      <natOp>this is post</natOp>
      <indPag>1</indPag>
      <mod>55</mod>
      <serie>1</serie>
      </ide>............
    Not giving full because it's too long.
    1. I Successfully registered Schema into database
    2. Then i generate table from registered Schema
    2. In my java code i validated XML document against Schema and it's successfully validate.
    3. But when i stored this XML into this generated table it's give me error
       Like :
    INSERT INTO XMLTABLE
    VALUES
    (XMLTYPE(bfilename('MYDIR','testabc.xml'),NLS_CHARSET_ID('AL32UTF8')))
    Error report:
    SQL Error: ORA-31061: XDB error: XML event error
    ORA-19202: Error occurred in XML processing
    LSX-00333: literal "94032000" is not valid with respect to the pattern
    And i have to store this xml into this tables so what i have to do ?

    Thanks for your reply odie_63.
    I got this my error solution. My XML document is not well structured based on my registered XML Schema.
    Means In My XML Document there are some invalid value and that not match my schema pattern so it's gives this error
    SQL Error: ORA-31061: XDB error: XML event error
    ORA-19202: Error occurred in XML processing
    LSX-00333: literal "94032000" is not valid with respect to the pattern
    For Solution we have two ways
    1. I have changed this literal "94032000" value in my xml file then save it.
    2.
    - We have to delete this schema then
    - we have to change Schema pattern for particular element
    like :--
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve"/>
      <xs:pattern value="[0-9]{3}"/>
    </xs:restriction>
    - then store xml into database it works..
    Thanks.

  • JDOMException thrown validating XML against a schema with Xerces2

    I'm trying to validate a document with JDOM and Xerces 2.
    I can validate it with XMLSpy (it works, my document is valid).
    But with JDOM and xerces, this error occurs when parsing and validating my document:
    org.jdom.JDOMException: Error on line 6 of document file:///E:/developpement/SitePerso/xml/xml/listeEntreprises.xml: cvc-complex-type.2.4.a: Invalid content starting with element 'item'. The content must match '(("":nom){0-1},("":item){0-UNBOUNDED})'.
    My XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by de Boussineau (none) -->
    <!--Sample XML file generated by XML Spy v4.3 U (http://www.xmlspy.com)-->
    <liste xmlns="E:/developpement/SitePerso/xml/domain~1/schemaListe" ... E:\developpement\SitePerso\xml\schemas\schemaListe.xsd">
    <item xsi:type="xsel:typeEntreprise">
    <xsel:nom>PHOENIX I.S.I.</xsel:nom>
    <xsel:groupe>Taffioles</xsel:groupe>
    <xsel:adresse>2 rue du centre</xsel:adresse>
    The element <nom> before <item> is not required. So what's the problem ?

    ...

  • Validate a XML file against multiple schema files

    Hello everybody!
    How can I validate a XML file against multiple schema files?
    I have the following XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <bulkCmConfigDataFile xmlns:es="SpecificAttributes.3.0.xsd"
                             xmlns:xn="genericNrm.xsd"
    xmlns="configData.xsd">
    <fileHeader fileFormatVersion="32.615 V4.2" vendorName=""/>
    <configData dnPrefix="Undefined">
    <xn:SubNetwork id="3G">
    <xn:SubNetwork id="RNC01">
    <xn:MeContext id="RNC01">
    <xn:VsDataContainer id="RNC01">
    <xn:attributes>
    <xn:vsDataType>vsDataMeContext</xn:vsDataType>
    <xn:vsDataFormatVersion>SpecificAttributes.3.0</xn:vsDataFormatVersion>
    <es:vsDataMeContext>
    <es:userLabel>RNC01</es:userLabel>
    <es:ipAddress>172.21.3.17</es:ipAddress>
    <es:neMIMversion>vF.5.0</es:neMIMversion>
    </es:vsDataMeContext>
                                  </xn:attributes>
    </xn:VsDataContainer>
    </xn:MeContext>
    </xn:SubNetwork>
    </xn:SubNetwork>
    </configData>
    <fileFooter dateTime="2006-11-24T11:56:07Z"/>
    </bulkCmConfigDataFile>
    I want to load this file into a table, validate it (against SpecificAttributes.3.0.xsd, genericNrm.xsd and configData.xsd) and query that table. How would the INSERT .. and the SELECT ... for userLabel attribute look like?
    Many thanks!

    Hi Peter,
    Please use the validateXML BPEL Property : This property validates incoming and outgoing XML documents. If set to true, the Oracle BPEL Process Manager applies schema validation for incoming and outgoing XML documents. This property is applicable to both durable and transient processes. The default value is false.
    Cheers
    A

  • Question about validating xml against schema

    Hi,
    I am new to JAXP. I try to validating a xml against a schema. I wrote following code:
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespace(true);
    spf.setValidating(true);
    SAXParser sp = spf.newSAXParser();
    sp.setProperty("http://java.sun.com/xml/properties/jaxp/schemaLanguage",
    "http://www.w3.org/2001/XMLSchema");
    sp.setProperty("http://java.sun.com/xml/properties/jaxp/schemaSource",
    "mySchema.xsd") ;
    sp.parse(<XML Document>, <ContentHandler);
    but when compile, it has error: can't resolve ""http://java.sun.com/xml/properties/jaxp/schemaLanguage", and
    "http://java.sun.com/xml/properties/jaxp/schemaSource".
    It seems it didn't support above two property.
    I saw some code in forum is:
    fact.setFeature("http://xml.org/sax/features/validation", true);
    fact.setFeature("http://apache.org/xml/features/validation/schema",true);
    fact.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    SAXParser sp = fact.newSAXParser();
    sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemas);
    Why sun tutorial use property:http://java.sun.com/xml/properties/jaxp/schemaLanguage
    and someone use:http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation
    where to get information about setting properties for SAXParserFactory?
    Thanks

    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

  • Error in validating XML against schema

    Hi am getting some critical errors while Validating XML against schema
    error is:
    cvc-elt.1: Cannot find the declaration of element 'position' , here <position> is my root element.
    my code is as follows:
    package com.glemser.xmLabeling.library.component.spl;
    import com.documentum.com.DfClientX;
    import com.documentum.com.IDfClientX;
    import com.documentum.fc.client.IDfClient;
    import com.documentum.fc.client.IDfSession;
    import com.documentum.fc.client.IDfSessionManager;
    import com.glemser.common.helper.OperationHelper;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParserFactory;
    import java.io.CharArrayWriter;
    import java.io.IOException;
    import java.io.InputStream;
    public class Test {
    static IDfSession m_session;
    public static void main(String[] args) {
    try {
         new Test().validate();
    } catch (Exception e) {
    e.printStackTrace();
    private XMLReader xmlReader;
    private DefaultHandler handler; // Defines the handler for this parser
    private boolean valid = true;
    public void validate() {
    try {
    SetXML setXML = new SetXML();
    OperationHelper operation = new OperationHelper();
    String splObjPath = "C://Documents and Settings/dparikh/My Documents/xmLabelingStage/Test.xml";//operation.executeExportOperation(m_session, new DfId(m_objectId), true);
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(false);
    spf.setValidating(true);
    spf.setFeature("http://xml.org/sax/features/validation", true);
    spf.setFeature("http://apache.org/xml/features/validation/schema", true);
    spf.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    if (spf.isValidating()) {
    System.out.println("The parser is validating");
    javax.xml.parsers.SAXParser sp = spf.newSAXParser();
    sp.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", "file://C:/Documents and Settings/dparikh/My Documents/xmLabelingStage/Test.xsd");
    System.out.println("The parser is validating1");
    //Create XMLReader
    xmlReader = sp.getXMLReader();
    xmlReader.setFeature("http://apache.org/xml/features/validation/schema", true);
    xmlReader.setEntityResolver(new SchemaLoader());
    ContentHandler cHandler = new MyDefaultHandler();
    ErrorHandler eHandler = new MyDefaultHandler();
    xmlReader.setContentHandler(cHandler);
    xmlReader.setErrorHandler(eHandler);
    System.out.println("The parser is validating2");
    parseDocument(splObjPath);
    } catch (SAXException se) {
    se.printStackTrace();
    } catch (ParserConfigurationException e) {
    e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    public void parseDocument(String xmlFile) {
    try {
    xmlReader.parse(xmlFile);
    if (valid) {
    System.out.println("Document is valid!");
    } catch (SAXException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    } catch (Exception e) {
    e.printStackTrace();
    class MyDefaultHandler extends DefaultHandler {
    private CharArrayWriter buff = new CharArrayWriter();
    private String errMessage = "";
    /* With a handler class, just override the methods you need to use
    // Start Error Handler code here
    public void warning(SAXParseException e) {
    System.out.println("Warning Line " + e.getLineNumber() + ": " + e.getMessage() + "\n");
    public void error(SAXParseException e) {
    errMessage = new String("Error Line " + e.getLineNumber() + ": " + e.getMessage() + "\n");
    System.out.println(errMessage);
    valid = false;
    public void fatalError(SAXParseException e) {
    errMessage = new String("Error Line " + e.getLineNumber() + ": " + e.getMessage() + "\n");
    System.out.println(errMessage);
    valid = false;
    public class SchemaLoader implements EntityResolver {
    public static final String FILE_SCHEME = "file://";
    public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
    if (systemId.startsWith(FILE_SCHEME)) {
    String filename = systemId.substring(FILE_SCHEME.length());
    InputStream stream = SchemaLoader.class.getClassLoader().getResourceAsStream(filename);
    return new InputSource(stream);
    } else {
    return null;
    My XML and XSD are as below:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="position" minOccurs="0" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="position_number" type="xsd:string"/>
    <xsd:element name="position_title" type="xsd:string"/>
    <xsd:element name="report_to_position" type="xsd:string"/>
    <xsd:element name="incumbent" type="xsd:string"/>
    <xsd:element name="operation" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    <position xsi:schemaLocation="Test.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <position_number>12345</position_number>
    <position_title>Sr. Engr</position_title>
    <report_to_position>23456</report_to_position>
    <incumbent>23456</incumbent>
    <operation>INSERT</operation>
    </position
    Please help me out

    --> Could not find cached enumeration value Custom.CI.Enum.PeripheralDevice.Printer for property Type, class BMC.Custom.CI.PeripheralDevice in enumeration cache.
    You must specify either the Name or Guid of an enumeration of type Custom.CI.Enum.PeripheralDevice.Type.
    Be sure that you are specifying the Name property of the enumeration value you want to set, and not the DisplayName; the Internal Name is something like "IncidentCategoryEnum.Category" for out of the box enumerations, or ENUM.210ADA2282FDABC3210ADA2282FDABC
    for enumerations created in the console.
    you can check this by finding the enumeration in the XML or by using the the
    SMLets commandlet
    Get-SCSMEnumeration | ?{$_.DisplayName –eq “Printer”}
    and then checking your value with
    Get-SCSMEnumeration -Name "ENUM.210ADA2282FDABC3210ADA2282FDABC"
    and see if you get the right displayname back

  • Validating XML against an XML Schema using PL/SQL

    Hello everyone,
    I've a strange problem.
    I'm trying to validate an XMLTYPE variable against an XSD schema using the XMLisValid function.
    The XML I was trying to validate was returning false (0) when using this method.
    However, when I register the XSD against a column in a table and then insert this XMLTYPE into that column, I do not get any errors. If I change the XSD to ensure failure when using this method, I do get an error, so it is registered and working.
    I have then created a very basic XSD and both methods work when validating the XML against this. So obviously the more complicated XSD I want to validate against is making a difference, but I would expect them to either both fail or both pass, not one fail and one pass.
    Does anyone know why they'd be returning different results?
    Thanks in advance for your help.
    Robin
    examples of what I'm using:
    XML to validate:
    <centres>
    <add>
    <centre>
    <centreName>Name 1</centreName>
    <centreRef>45678</centreRef>
    </centre>
    </add>
    </centres>
    Simple XSD:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="centres" type="centresType"/>
    <xs:complexType name="addType">
    <xs:sequence>
    <xs:element type="xs:string" name="centreName"/>
    <xs:element type="xs:short" name="centreRef"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="centresType">
    <xs:sequence>
    <xs:element type="addType" name="add" maxOccurs="3" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    Complicated XSD:
    <?xml version="1.0" encoding="utf-8" ?>
    <!--Created with Liquid XML Studio - 30 Day Trial Edition 7.1.6.1440 (http://www.liquid-technologies.com)-->
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="centres">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="remove">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="centreRef">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="add">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="centre">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="centreName">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="100" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="centreRef">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element minOccurs="0" maxOccurs="1" name="qualifications">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="qualRef">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="100" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="modifyQualAssociations">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="remove">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="r">
    <xs:complexType>
    <xs:attribute name="centreRef" use="required">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="qualRef" use="required">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="100" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="add">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="a">
    <xs:complexType>
    <xs:attribute name="centreRef" use="required">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="qualRef" use="required">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="100" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    Steps to validate XML data against a schema in Oracle:
    1. Register your XSD in the database.
    begin
    dbms_xmlschema.registerschema(
    SchemaUrl,
    SchemaDoc,
    local => TRUE/FALSE);
    end;
    2. For validating your XML document against your registered schema, here is a sample pl/sql block.
    declare
    v_xml xmltype;
    begin
    v_xml := your_xml_document;
    v_xml.schemaValidate();
    end;
    Hope this helps :)

  • Does Oracle support "imported" XML schemas

    Hi,
    Does Oracle support XML schemas that import other XML schemas. If so, are there any known problems ?
    Thanks
    John

    I have the same problem:
    A huge and complex .xsd-schema with several include and import statements can't be registered (all referenced documents exist in the repository):
    DBMS_XMLSCHEMA.REGISTERSCHEMA(
    schemaURL => 'http://www.toxinfo.org/namespaces/2004/05/Rosetta#ProtocolEmil',
    schemaDoc => xdbURIType('/ProtocolEmil.xsd').getClob(),
    local => TRUE,
    genTypes => TRUE,
    genBean => FALSE,
    genTables => TRUE
    causes an Error at the first import:
    ERROR at line 1:
    ORA-31000: Resource 'RosettaSimpleTypeCollection.xsd' is not an XDB schema
    document
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 17
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26
    ORA-06512: at line 2
    Editing the schema is not an option for me. Any ideas?
    Thanks!
    Tillmann Cordes

  • ORA-19201: Datatype not supported when validating XML against an XSD

    Hello.
    Info: using Oracle 10.2.0.1.0, Java components are installed.
    I've created an XML view using ora:view, which is validated against a registered XSD. This view is created successfully.
    But when I SELECT * from this view, it gives ORA-19201 - Datatype not supported.
    Can't understand why. I've matched the XML to the XSD, and the datatypes all look fine to me. I've referred to the XSD using the XMLFORMAT.CREATEFORMAT option. When I use the same option to specify "NO_SCHEMA", it returns the correct XML, but we need to validate it against the XSD.
    I'm thinking one of two things has happened here:
    1. I've made a mistake with either my registration, or how I've used XMLFORMAT to refer to the XSD.
    2. There's a bug in Oracle.
    My money's on 1. Can anyone help?
    Thanks,
    Ray.

    Hello Geoff, I didn't want to send any code until I knew someone was willing to look at it (there's a lot of it).
    Here is the XSD:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!--W3C Schema generated by XMLSpy v2006 rel. 3 sp1 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="TransInfo">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="PIE_ERROR" type="PIE_ERRORType" minOccurs="0"/>
                        <xs:element name="Transaction" type="TransactionType" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:complexType name="PIE_ERRORType">
              <xs:sequence>
                   <xs:element ref="ERROR_CODE"/>
                   <xs:element ref="DESCRIPTION"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="ERROR_CODE">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="0001"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="DESCRIPTION">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="LEAD NUMBER 12345 IS INVALID"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:complexType name="TransactionType">
              <xs:sequence>
                   <xs:element ref="TRANSACTION_NUMBER"/>
                   <xs:element ref="TRANSACTION_STATUS"/>
    <xs:element ref="CONTACT_ID"/>
                   <xs:element ref="INVOICE_NUMBER"/>
                   <xs:element ref="CHANNEL"/>
                   <xs:element ref="CSA"/>
                   <xs:element ref="OPEN_DATETIME"/>
                   <xs:element ref="CLOSED_DATETIME"/>
                   <xs:element name="Orderline" type="OrderlineType" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="TRANSACTION_NUMBER">
              <xs:simpleType>
                   <xs:restriction base="xs:int">
                        <xs:enumeration value="3455229"/>
                        <xs:enumeration value="3455230"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="TRANSACTION_STATUS">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="C"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="CONTACT_ID">
              <xs:simpleType>
                   <xs:restriction base="xs:int">
                        <xs:enumeration value="111"/>
                        <xs:enumeration value="222"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="INVOICE_NUMBER">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="123456789"/>
                        <xs:enumeration value="987654321"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="CHANNEL">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="Test 1"/>
                        <xs:enumeration value="Test 2"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="CSA">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="SEARLEA"/>
                        <xs:enumeration value="SILVAJ"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="OPEN_DATETIME">
              <xs:simpleType>
                   <xs:restriction base="xs:dateTime">
                        <xs:enumeration value="2001-10-26T20:32:52"/>
                        <xs:enumeration value="2004-12-06T10:23:25"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="CLOSED_DATETIME">
              <xs:simpleType>
                   <xs:restriction base="xs:dateTime">
                        <xs:enumeration value="2001-10-26T21:32:52"/>
                        <xs:enumeration value="2004-12-06T10:23:25"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:complexType name="OrderlineType">
              <xs:sequence>
                   <xs:element ref="ORDER_QTY"/>
                   <xs:element ref="RETAIL_AMT"/>
                   <xs:element ref="SALE_AMT"/>
                   <xs:element ref="PRODUCT_DESCR"/>
                   <xs:element ref="PART"/>
                   <xs:element ref="IMEI"/>
                   <xs:element name="BankDetails" type="BankDetailsType"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="ORDER_QTY">
              <xs:simpleType>
                   <xs:restriction base="xs:int">
                        <xs:enumeration value="1"/>
                        <xs:enumeration value="3"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="RETAIL_AMT">
              <xs:simpleType>
                   <xs:restriction base="xs:decimal">
                        <xs:enumeration value="45.67"/>
                        <xs:enumeration value="54.76"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="SALE_AMT">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="45.67"/>
                        <xs:enumeration value="54.76"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="PRODUCT_DESCR">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="Product test 2"/>
                        <xs:enumeration value="Vodafone Nokia 6230 Pack"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="PART">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="6806"/>
                        <xs:enumeration value="8606"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="IMEI">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="099000000000001"/>
                        <xs:enumeration value="09900078900001"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:complexType name="BankDetailsType">
              <xs:sequence>
                   <xs:element ref="BANK_NAME"/>
                   <xs:element ref="ACCOUNT_NAME"/>
                   <xs:element ref="ACCOUNT_NUMBER"/>
                   <xs:element ref="SORT_CODE"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="BANK_NAME">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="HSBC"/>
                        <xs:enumeration value="LLOYDS"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="ACCOUNT_NAME">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="MR A SEARLE"/>
                        <xs:enumeration value="MR J SILVA"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="ACCOUNT_NUMBER">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="87698789"/>
                        <xs:enumeration value="89769082"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="SORT_CODE">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="100928"/>
                        <xs:enumeration value="123346"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
    </xs:schema>
    I then registered this XSD using DBMS_XMLSCHEMA.REGISTER, calling it test_1.xsd. It is visble in USER_XML_SCHEMAS.
    Here are the 15 views used to drive the XML:
    SQL> desc v_pie_branch
    Name Null? Type
    BRANCH NOT NULL NUMBER(4)
    SQL> desc v_pie_branch_feature
    Name Null? Type
    BRANCH_FEATURE NOT NULL NUMBER(10)
    BRANCH NUMBER(4)
    FEATURE_TYPE VARCHAR2(10)
    CHANNEL VARCHAR2(40)
    SQL> desc v_pie_transaction
    Name Null? Type
    TRANSACTION_NUMBER NOT NULL NUMBER(10)
    BRANCH NUMBER(4)
    EMPLOYEE_TRANS VARCHAR2(12)
    CONTACT NUMBER(8)
    OPEN_DAT DATE
    OPEN_TIM DATE
    TRANSACTION_STATUS VARCHAR2(1)
    TRANS_TYPE VARCHAR2(1)
    CLOSED_DAT DATE
    CLOSED_TIM DATE
    INVOICE_NUMBER NUMBER(10)
    INVOICE_DAT DATE
    CSA VARCHAR2(12)
    CREATED_ON DATE
    AMENDED_BY VARCHAR2(12)
    AMENDED_ON DATE
    OPEN_DATETIME VARCHAR2(19)
    CLOSED_DATETIME VARCHAR2(19)
    SQL> desc v_pie_bank_detail
    Name Null? Type
    BANK_DETAIL NOT NULL NUMBER(12)
    BANKCODE VARCHAR2(40)
    SORTCODE VARCHAR2(40)
    BANK_NAME VARCHAR2(60)
    SQL> desc v_pie_account_detail
    Name Null? Type
    ACCOUNT_DETAIL NOT NULL NUMBER(12)
    BANK_DETAIL NUMBER(12)
    ACCOUNT_NUMBER VARCHAR2(40)
    SORT_CODE VARCHAR2(40)
    ACCOUNT_NAME VARCHAR2(40)
    BANKCODE VARCHAR2(40)
    SQL> desc v_pie_account_link
    Name Null? Type
    ACCOUNT_LINK NOT NULL NUMBER(12)
    CONTACT NUMBER(12)
    ACCOUNT_DETAIL NUMBER(12)
    ACC_LINK_TYP NUMBER(12)
    BNK_SINCE DATE
    AC_DET VARCHAR2(40)
    SQL> desc v_pie_compesn
    Name Null? Type
    COMPESN NOT NULL NUMBER(10)
    CONTACT NUMBER(8)
    IMEI VARCHAR2(25)
    SQL> desc v_pie_contact
    Name Null? Type
    CONTACT_ID NOT NULL NUMBER(8)
    CONTACT_TYP VARCHAR2(1)
    COMPANY NUMBER(10)
    BRANCH NUMBER(4)
    DEAD_FLG VARCHAR2(1)
    FORENAME VARCHAR2(20)
    TITLE VARCHAR2(5)
    MID_INITIAL VARCHAR2(1)
    GENDER VARCHAR2(1)
    FRAUD_FLG VARCHAR2(1)
    SQL> desc v_pie_servcon
    Name Null? Type
    SERVCON NOT NULL NUMBER(10)
    CONTRACT NUMBER(10)
    CONNECTION_CURR NUMBER(10)
    CONTACT NUMBER(8)
    SQL> desc v_pie_tpplan_compline
    Name Null? Type
    TPPLAN_COMPLINE NOT NULL NUMBER(10)
    SERVCON NUMBER(10)
    PPLAN NUMBER(10)
    SQL> desc v_pie_tpplan_comp_detail
    Name Null? Type
    TPPLAN_COMPLINE NOT NULL NUMBER(10)
    RULE_DETAIL_NO NOT NULL VARCHAR2(5)
    RULE_DETAIL_LINE NOT NULL NUMBER(2)
    U_VERSION VARCHAR2(1)
    OPTION VARCHAR2(40)
    OPT_STRING VARCHAR2(40)
    SQL> desc v_pie_tpplan
    Name Null? Type
    SERVCON NOT NULL NUMBER(10)
    PPLAN NOT NULL NUMBER(10)
    U_VERSION VARCHAR2(1)
    SQL> desc v_pie_connection
    Name Null? Type
    CONNECTION NOT NULL NUMBER(10)
    CONTACT NUMBER(8)
    ADDRESSNO NUMBER(5)
    TRANSACTION NUMBER(10)
    TPRODLINE NUMBER(10)
    CONTRACT NUMBER(10)
    SERVCON NUMBER(10)
    SQL> desc v_pie_tprodline
    Name Null? Type
    TRANSACTION NOT NULL NUMBER(10)
    TPRODLINE NOT NULL NUMBER(10)
    CONTACT NUMBER(8)
    PRODUCT NUMBER(10)
    ORDER_QTY NUMBER(12)
    RETAIL_AMT NUMBER
    SALE_AMT NUMBER
    SQL> desc v_pie_product
    Name Null? Type
    PRODUCT NOT NULL NUMBER(10)
    PART VARCHAR2(20)
    PRODUCT_DESCR VARCHAR2(40)
    This is the code to create an XML view, validating against the schema:
    create OR REPLACE VIEW v_xml_validate AS
    SELECT SYS_XMLAGG(XMLQuery('
    <PIE_ERROR>
    <ERROR_CODE>"0001"</ERROR_CODE>
    <DESCRIPTION>"There was an error with this customer"</DESCRIPTION>
    </PIE_ERROR>,
    <Transaction>
    {for $t in ora:view("V_PIE_TRANSACTION")/ROW
        ,$ct in ora:view("V_PIE_CONTACT")/ROW
        ,$b in ora:view("V_PIE_BRANCH")/ROW
        ,$bf in ora:view("V_PIE_BRANCH_FEATURE")/ROW
    where $t/CONTACT = $ct/CONTACT_ID
    and   $t/BRANCH = $b/BRANCH
    and   $b/BRANCH = $bf/BRANCH
    return ($t/TRANSACTION_NUMBER
            ,$t/TRANSACTION_STATUS
            ,$ct/CONTACT_ID
            ,$t/INVOICE_NUMBER
            ,$bf/CHANNEL
            ,$t/CSA
            ,$t/OPEN_DATETIME
            ,$t/CLOSED_DATETIME
            ,<Orderline>
                  {for $tpl in ora:view("V_PIE_TPRODLINE")/ROW
                      ,$pr  in ora:view("V_PIE_PRODUCT")/ROW
                      ,$cmpesn  in ora:view("V_PIE_COMPESN")/ROW
                   where $tpl/TRANSACTION eq $t/TRANSACTION_NUMBER
                   and   $tpl/PRODUCT eq $pr/PRODUCT
                   and   $ct/CONTACT_ID eq $cmpesn/CONTACT
                   return ($tpl/ORDER_QTY
                          ,$tpl/RETAIL_AMT
                          ,$tpl/SALE_AMT
                          ,$pr/PRODUCT_DESCR
                          ,$pr/PART
                          ,$cmpesn/IMEI
                          ,<BankDetails>
                               {for $conn in ora:view("V_PIE_CONNECTION")/ROW
                                for $scon in ora:view("V_PIE_SERVCON")/ROW
                                for $tpp in ora:view("V_PIE_TPPLAN")/ROW
                                for $tppc in ora:view("V_PIE_TPPLAN_COMPLINE")/ROW
                                for $tppcd in ora:view("V_PIE_TPPLAN_COMP_DETAIL")/ROW
                                for $al in ora:view("V_PIE_ACCOUNT_LINK")/ROW
                                for $ad in ora:view("V_PIE_ACCOUNT_DETAIL")/ROW
                                for $bd in ora:view("V_PIE_BANK_DETAIL")/ROW
                                where $conn/CONTACT eq $ct/CONTACT_ID
                                and   $scon/CONTACT eq $conn/CONTACT
                                and   $tpp/SERVCON eq $scon/SERVCON
                                and   $tppc/SERVCON eq $tpp/SERVCON
                                and   $tppc/PPLAN eq $tpp/PPLAN
                                and   $tppcd/TPPLAN_COMPLINE eq $tppc/TPPLAN_COMPLINE
                                and   $al/AC_DET eq $tppcd/OPT_STRING
                                and   $ad/ACCOUNT_DETAIL eq $al/ACCOUNT_DETAIL
                                and   $bd/BANK_DETAIL eq $ad/BANK_DETAIL
                                return ($bd/BANK_NAME
                                       ,$ad/ACCOUNT_NAME
                                       ,$ad/ACCOUNT_NUMBER
                                       ,$ad/SORT_CODE
    </BankDetails>
    </Orderline>
    </Transaction>'
    RETURNING CONTENT),
    XMLFORMAT.CREATEFORMAT('TransInfo','USE_GIVEN_SCHEMA','test_1.xsd', 'http://xmlns.cpw.co.uk/CPW/EPOS/Order/RetrieveTransaction/RetrieveTransaction', NULL, NULL)) AS xml_string FROM DUAL;
    The view is created with no errors. Selecting * from it, however, gives:
    ORA-19201 - Datatype not supported
    Marrying the XML to the XSD shows nothing obviously wrong.
    Thanks,
    Ray.

  • Validating XML against XSD

    Hi,
    I would like to validate XML against XSD using SAX parser. Can any one help, where I can get information. I could get some information of XML validation against DTD. But could not get much information for XSD validation.
    Which parser is good for validation against XSD? or shall I continue with SAX Parser?
    Kumaravel

    I use the "Summer 02 XML Pack" provided here at Sun, which is based on Xerces2 by Apache (http://xml.apache.org/xerces2-j/index.html). Actually with that, validation against schemas is pretty much like validation against DTDs, as long as the schema is referenced in your XML file and you switch on schema validation in the parser like
    reader.setFeature("http://xml.org/sax/features/validation", true);
    reader.setFeature("http://apache.org/xml/features/validation/schema", true);Xerces2 works both with DOM and SAX (I use SAX). You should browse Apache's website a bit. There's not too much information, but I guess it's enough to get started.

  • Getting an Out of memory exception while validating XML against XSD

    Hello friends,
    I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            saxParserFactory.setValidating(true);
              SAXParser saxParser = saxParserFactory.newSAXParser();
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",new File("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
    Thanks.

    Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory

  • Validating xml doc using schema

    I was wondering if you can the following validation of an xml document using schema:
    <parent>
        <child>Jogn</child>
        <child>Hanna</child>
        <child>Blake</child>
        <childCount>3</childCount>
    <parent>the childcountValue equals the number of child node. is this possible using
    schema or do do i have to use an application to do this?
    thanx in advance

    thanx dvohra, but i already know how to validate schema using a parser.
    I'm looking for a way in the schema that specified thhat the total number of child elemnt equals to the integer value of the childTotal element. I don't even know if this is possible. If possible, what (tag) would i use. i don't need answer..hint would be nice.
    my other solution is to write an application that use a SAX parser to parse the xml doc. Although this is relatively easy, i would like to keep the validation within on file (the schema)..rather than have it be in the schema and a ContentHandler.

  • Validating xml with external schema

    Hi,
    I want to validate a xml against an external schema using java and the xml WILL NOT contain any reference to the schema. Any help in the matter is most welcome.
    A typical example of such an xml is given below:
    <Envelope >
    <Body>
    " Some content here"
    </Body>
    </Envelope>
    I used the following code but it did not validate the xml.It simply parsed.
    public class TestParser {
         public static void main(String[] args) {
              final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
              final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
              try {
                   SAXParserFactory saxpfactory = SAXParserFactory.newInstance();
                   saxpfactory.setNamespaceAware(true);//
                   saxpfactory.setValidating(true);//
                   SAXParser parser = saxpfactory.newSAXParser();
                   parser.setProperty(JAXP_SCHEMA_LANGUAGE, "http://www.w3.org/2001/XMLSchema");//
                   parser.setProperty(JAXP_SCHEMA_SOURCE, "http://www.w3.org/2001/06/soap-envelope");//
                   parser.parse(new File("C:\\TEMP\\request.xml"), new DefaultHandler());
              } catch (FileNotFoundException fileNotFoundException) {
                   fileNotFoundException.printStackTrace();
              } catch (IOException ioException) {
                   ioException.printStackTrace();
              } catch (SAXException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (ParserConfigurationException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              System.out.println("exiting main ");
    Regards

    In the schema root element xs:schema add namespace declaration.
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    In the XML document root element add xmlns:xsi and xsi:noNamespaceSchemaLocation attributes.
    <root_element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://c:/testing.xsd">

  • Does SAP Support the "XML Process Definition Language" (XPDL)

    Does SAP support XPDL. IF not what is the alternative standard that they support?
    regards,
    Thomas

    As far as I know there isn't any support for XML process description language. they only alternative is OMG BPDL, which is still under work.
    Many people tend to compare XPDL to BPEL, although it is not so right. I think that this link http://kswenson.wordpress.com/2006/05/26/bpmn-xpdl-and-bpel/ explain it.
    HTH,
    Natty Gur.

Maybe you are looking for

  • Partitioning an ext. HD for use with Time Machine HFS+/FAT32

    Hi, I hope that this question is not already answered somewhere - I did a couple of searches but couldn't find the answers I need. I'm setting up an external LaCie 500GB HD (USB 2.0) for a friend, in order to use it for Time Machine backups (one part

  • Http request missing form data 4.5.1

              We occassionally have problem with an Http request not having the form data that was entered. If you hit the back button and resubmit the form everything works fine.           We have IPlanet webservers and WLS 4.5.1.           

  • I am being told I need a wpa2 password to login to wifi. .

    I am being told I need a wpa2 password to login to wifi.  The business where I am has a strong wifi And I'm using the correct password. Others here are able to log on. Why can't I? Brand new MacBook Air/snow Leopard. Any ideas? Thanks.

  • Visual Composer VC implemented in WAD BEx Web Application

    Hi, is it possible to implement visual composer graphic into simple WAD BEx Web Template? If yes, how? Thank you for any hints. Greetings Standa

  • Using tar to extract hadoop stable

    I keep getting the following error regardless which version of stable hadoop archive I download. Did anyone face this issue before?. I have latest and greatest, updated Mavericks OS. tar: Unrecognized archive format Any help is appreciated.