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 ?

...

Similar Messages

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

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

  • 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

  • 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

  • Re: Validation Against A Schema With DOM

    I tried to redeploy a properly working application using Schema not DTD. It worked perfectly before but after redeployment, I got this an error complaining of missing "AbstractDOMParser". I downloaded this jar "xercesImpl.jar" which contain "AbstractDOMParser" . The error is gone away. However, a new error popped up as following. Remember, I don't encounter any problem like this before redeployment.
    Recoverable Error: Document is invalid: no grammar found. ( Check line number:2, column:7)
    Recoverable Error: Document root element "rules", must match DOCTYPE root "null". ( Check line number:2, column:7)
    My guess is that I downloaded the wrong Parser. I need a parser for Schema not DTD. Where can I download the parser for Schema (not DTD parser)? any other potential factors, which you all can think of ,caused this error? Any input I really appreciate.
    Here is my XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <rules xsi:noNamespaceSchemaLocation="/SUNWappserver7/domains/domain1/applications/j2ee-modules/olbr_1/WEB-INF/classes/schemas/ezgov_bre.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <rules-package name="Navigation">
    <rule-script name="GetNextNavigationId">
    # initialize values
    navId = ""
    if (NavigationControllerDataSetName_navigationControllerCurrentNavigationId != N
    one):
    navId = NavigationControllerDataSetName_navigationControllerCurrentNavigatio
    nId.lower()
    newNavId = ""
    if (NavigationControllerDataSetName_navigationControllerNavigationId != None):
    newNavId = NavigationControllerDataSetName_navigationControllerNavigationId.
    lower()
    action = ""
    Thanks in advance,
    Van

    Set the parser as a schema validating parser.
    parser.setFeature("http://xml.org/sax/features/validation",
                      true);Set the validation/schema feature to true to report validation errors against a schema.
    parser.setFeature("http://apache.org/xml/features/validation/schema",
                      true);Set the validation/schema-full-checking feature to true to enable full schema, grammar-constraint checking.
    parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",
                      true);

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

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

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

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

  • Regarding validating XML against DTD

    hello,
    In my project I am receiving xml via HTTP post request
    and this XML needs to be validated against a DTD in a remote server.
    e.g. assume the xml to be
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE PUSH SYSTEM "http:\\whatever:xx\whatever\sms.dtd">
    <PUSH ICP="Partenaire" ADM="UtilisateurChezPartenaire" VERSION="1.0">
    </PUSH>
    the java code uses Xerces parser
          DOMParser parser = new DOMParser();
          parser.setFeature("http://xml.org/sax/features/validation", true);
          parser.setProperty(
                             "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                             "http:\\whatever:xx\whatever\sms.dtd"");
          parser.parse("c://localcopy/sms.xml");this Works fine.
    But in some case I receive xml file without any !DOCTYPE declaration
    (but is still needs to be validated against the same DTD as its mentioned in the business rules)
    in such case how can the XML be validated against the DTD.
    am I extected to add the
    <!DOCTYPE PUSH SYSTEM "http:\\whatever:xx\whatever\sms.dtd">
    to every XML via some XSLT script or is there a direct way of
    validating a xml that has no DOCTYPE reference to a DTD
    (the assumption is the DTD location is known beforehand)

    ok, i managed to solve the problem my self, using Transformer makes the job easier.
    here is the code for anyone who might run into the same problem.#
         public void whatEver(){
              try{
                   DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
                   Document xmlDocument = dBuilder.parse(new FileInputStream("c://a.xml"));
                   DOMSource source = new DOMSource(xmlDocument);
                   //StringWriter writer = new StringWriter();
                   StreamResult result = new StreamResult("c://a.xml");
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer transformer = tf.newTransformer();
                   transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "./transformations/Push_Gateway.dtd");
                   //TransformerFactory transformerFactory = TransformerFactory.newInstance();
                   //Transformer newtransformer = transformerFactory.newTransformer();
                   transformer.transform(source, result);
              catch(Exception e){
                   e.printStackTrace();
         }the above code reads the a.xml file and adds/removes the DOCTYPE as specified in the transformer.setOutputProperty method and the same xml file is updated, this way different DTD could be referenced by the same xml and validated. this saves the process of adding/removing DOCTYPE via xslt.

  • How to check against hierachy schema with MDM?

    Hi,
    I have to use SRM-MDM to load supplier catalogs for SRM. Our suppliers deliver a XML Catalog structure with classification in a format like this:
    <ARTICLE_FEATURES>
    <REFERENCE_FEATURE_SYSTEM_NAME>ECLASS-4.0</REFERENCE_FEATURE_SYSTEM_NAME>
    <REFERENCE_FEATURE_GROUP_ID>21050101</REFERENCE_FEATURE_GROUP_ID>
    or
    <ARTICLE_FEATURES>
    <REFERENCE_FEATURE_SYSTEM_NAME>ECLASS-5.10</REFERENCE_FEATURE_SYSTEM_NAME>
    <REFERENCE_FEATURE_GROUP_ID>30020101</REFERENCE_FEATURE_GROUP_ID>
    I built up 2 tables eclass40 and eclass 513 in SRM-MDM as hierarchy tables. While importing the supplier xml I what to check against the REFERENCE_FEATURE_GROUP_ID (the class number). If the number does not exist in the class system the dataset should not be load.
    How can I do this?
    Best regards
    Roman

    thank you guys for your tries - but my question is still not answered.
    I will try to depict what i need in more details:
    1)process A with instance id (orabpel.cube_instace.cikey) = 1 is in closed.completed status.
    process A with instance id = 2 is in open.running status.
    2) i redeploy process A with the same version:
    process A with instance id = 1 now is in closed.stale status
    process A with instance id = 2 now is in closed.stale status
    question: how to query from orabpel schema instance which was not completed before it went to stale (in example above it's instance id = 2 only) = really really staled?
    thanks in advance!

  • Validating XML against an external DTD

    I've three questions concerning the validation of an XML file on Checkin:
    1. Can the SimpleXMLParser validate an XML file against an external (internal) DTD.
    2. How do I have to construct the !DOCTYPE Reference in my XML file for the parser to find my external DTD
    3. Do I need to have a iFS type definition for my file to get it validated
    null

    Yes, DTD Validation is supported for 1.1
    but its not supported on a Per document basis
    or a per protocol basis.
    There is a System wide Property called
    IfsDefaultDTDValidation which if set to true
    will turn on validation for the entire
    system (all protocols)
    In addition, there is also support for a validate option to be passed to the parser
    (which is currently not exposed for 1.1 through the protocols) but a Custom Parser
    or application can set the validate mode on.
    The validate option setting takes preference
    over the IfsDefaultDTDValidation setting
    null

Maybe you are looking for

  • Please add support for JPEG Exchangeable Image File Format (EXIF)

    It seems that now Adobe® Illustrator® can export only to the JPEG File Interchange Format (JFIF). We should have an option to produce the JPEG Exchangeable image file format (EXIF) as well (just like Photoshop does!). Why this is so important to me?

  • Need help with AS3 to play movies

    Here is my what I'm working with: Flash CS3, AS3. I have 4 buttons and 4 movies (each button will be asigned to play one of the 4 movies). Not sure if this is the best layout but here is what's included in my file. I have an Actions layer, 4 buttons

  • Import movie from DVD

    I have a dvd burned with movies from my old camcorder. How do I import these movies into imovie so they can be edited? They play fine with idvd but I am not able to import

  • Issues installing itunes + quicktime error code 2203

    Every time I try install version 7 itunes + quicktime I get an error code 2203. HELP!!   Windows XP Pro   service pack 2

  • Picture app wont open

    its just as the title states, so i was saving a picture from the internet and when it got done i went to the picture app, and it  tries to load my pictures folder for about 5 seconds, then it cancels out to the home screen. I have already tried hard