Xdksample_093001.zip - Schema Validation example

I have downloaded this example and installed it as per
instructions.
when I try to run it I get the following error.
The following error has occurred:
ORA-29532: Java call terminated by uncaught Java exception:
oracle.xml.parser.schema.XSDException: Element 'schema' has
invalid namespace: 'http://www.w3.org/2001/XMLSchema'
ORA-06512: at "NM31.SCHEMAUTIL", line 0
ORA-06512: at line 15
Details:
ORA-29532: Java call terminated by uncaught Java exception:
oracle.xml.parser.schema.XSDException: Element 'schema' has
invalid namespace: 'http://www.w3.org/2001/XMLSchema'
ORA-06512: at "NM31.SCHEMAUTIL", line 0
ORA-06512: at line 15
How do I/Can I resolve this?

Hi Jinyu
This is the java code loaded in the database using loadjava called by a wrapper oracle stored procedure
import oracle.xml.parser.schema.*;
import oracle.xml.parser.v2.*;
import java.net.*;
import java.io.*;
import org.w3c.dom.*;
import java.util.*;
import oracle.sql.CHAR;
import java.sql.SQLException;
public class SchemaUtil
public static String validation(CHAR xml, CHAR xsd)
throws Exception
//Build Schema Object
XSDBuilder builder = new XSDBuilder();
byte [] docbytes = xsd.getBytes();
ByteArrayInputStream in = new ByteArrayInputStream(docbytes);
XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
//Parse the input XML document with Schema Validation
docbytes = xml.getBytes();
in = new ByteArrayInputStream(docbytes);
DOMParser dp = new DOMParser();
// Set Schema Object for Validation
dp.setXMLSchema(schemadoc);
dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
dp.setPreserveWhitespace (true);
StringWriter sw = new StringWriter();
dp.setErrorStream (new PrintWriter(sw));
try
dp.parse (in);
sw.write("The input XML parsed without errors.\n");
catch (XMLParseException pe)
sw.write("Parser Exception: " + pe.getMessage());
catch (Exception e)
sw.write("NonParserException: " + e.getMessage());
return sw.toString();
This is the code i used initially for validating a xml file against single xml schema (.xsd) file
In the above code could u tell how to specify the second schema validation code for the incoming xml.
say i create another Schemadoc for the 2nd xml schema.
something like this with another parameter(CHAR xsd1) passing to the method
byte [] docbytes1 = xsd1.getBytes();
ByteArrayInputStream in1 = new ByteArrayInputStream(docbytes1);
XMLSchema schemadoc1 = (XMLSchema)builder.build(in1,null);
DOMParser dp = new DOMParser();
How to set for the 2nd xml schema validation in the above code or can i combine 2 xml schemas.
How to go about it
Rgrds
Sushant

Similar Messages

  • This is an example of schema validating with error feedback

    Hi,
    Hope this is of help....
    This is an example of schema validating WITH error feedback
    public boolean validate(InputStream is) {
    // create and setup the DOM parser object
    parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.setValidationMode(XMLConstants.SCHEMA_STRICT_VALIDATION);
    boolean isValid = false;
    if (is != null) {
    try {
    parser.parse(new InputSource(is));
    isValid = true;
    } catch (XMLParseException e) {
    for (int i = 0; i<e.getNumMessages() ;i++){
    System.out.println("XMLParseException nr:"+new Integer(i+1)+" \'imsmanifest.xml\' line nr: "+new Integer(e.getLineNumber(i))+" col nr:"+
    new Integer(e.getColumnNumber(i))+" (formatErrorMessage: "+e.formatErrorMessage(i)+") ["+e.getMessage(i)+"]");
    } catch (java.io.IOException e) {
    System.out.println("IOException: Error creating input source [" + e.getMessage() + "]");
    } catch (org.xml.sax.SAXException e) {
    System.out.println("SAXException: Error parsing [" + e.getMessage() + "]");
    } catch (Exception e){
    System.out.println("Exception: Error parsing [" + e.getMessage() + "]. ");
    doc = parser.getDocument();
    return isValid;
    regards
    Jon

    "personally, I'd just put the exception handling into the package."
    Maybe I am making this over-complicated. I would like all the error handling in the package. It seems like putting an ONSERVERERROR trigger would be a little overkill, and if it fires on every database error, and I have to screen for only my errors seems like a little overkill and to me, it seems like it would incur quite a bit of overhead for the database seeing it is firing for every error. I don't even know if I would ultimately be allowed to keep it.
    Really, all I would want to do is:
    1) Handle the error and recover if possible
    2) If it is a fatal error, have a way to abort the package gracefully with some kind of record of it.
    3) Allow for the possibility of non-fatal errors or messages, even that I might generate myself to be able to be logged.
    This package has about 20 procedures now. If I have an error (particularly fatal), in let's say, procedure 8, I don't even know what happens. I don't know if by default it aborts the whole package or just that procedure or just keeps going. Is it possible to get just hung up and sit there?
    Thanks for the input.

  • Xml schema validation problem

    Hi All
    How to tackle this xml schema validation problem
    i am using the sample code provided by ORacle technet for xml
    schema validation in the Oracle database(817).
    The sample code works perfectly fine.
    Sample as provided by http://otn.oracle.com/tech/xml/xdk_sample/archive/xdksample_093001.zip.
    It works fine for normal xml files validated against
    xml schema (xsd)
    but in this case my validation is failing . Can you let me know why
    I have this main schema
    Comany.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.company.org"
    xmlns="http://www.company.org"
    elementFormDefault="qualified">
    <xsd:include schemaLocation="Person.xsd"/>
    <xsd:include schemaLocation="Product.xsd"/>
    <xsd:element name="Company">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Person" type="PersonType" maxOccurs="unbounded"/>
    <xsd:element name="Product" type="ProductType" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    ================
    which includes the following 2 schemas
    Product.xsd
    ============
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="Type" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    ==============
    Person.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="PersonType">
    <xsd:sequence>
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="SSN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    =================
    now when i try to validate a xml file against Company.xsd
    it throws an error saying unable to find Person.xsd.
    no protocol error
    Now where do i place these 2 schemas(.xsd files) Person & product
    so that the java schemavalidation program running inside Oracle
    database can locate these files
    Rgrds
    Sushant

    Hi Jinyu
    This is the java code loaded in the database using loadjava called by a wrapper oracle stored procedure
    import oracle.xml.parser.schema.*;
    import oracle.xml.parser.v2.*;
    import java.net.*;
    import java.io.*;
    import org.w3c.dom.*;
    import java.util.*;
    import oracle.sql.CHAR;
    import java.sql.SQLException;
    public class SchemaUtil
    public static String validation(CHAR xml, CHAR xsd)
    throws Exception
    //Build Schema Object
    XSDBuilder builder = new XSDBuilder();
    byte [] docbytes = xsd.getBytes();
    ByteArrayInputStream in = new ByteArrayInputStream(docbytes);
    XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
    //Parse the input XML document with Schema Validation
    docbytes = xml.getBytes();
    in = new ByteArrayInputStream(docbytes);
    DOMParser dp = new DOMParser();
    // Set Schema Object for Validation
    dp.setXMLSchema(schemadoc);
    dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    dp.setPreserveWhitespace (true);
    StringWriter sw = new StringWriter();
    dp.setErrorStream (new PrintWriter(sw));
    try
    dp.parse (in);
    sw.write("The input XML parsed without errors.\n");
    catch (XMLParseException pe)
    sw.write("Parser Exception: " + pe.getMessage());
    catch (Exception e)
    sw.write("NonParserException: " + e.getMessage());
    return sw.toString();
    This is the code i used initially for validating a xml file against single xml schema (.xsd) file
    In the above code could u tell how to specify the second schema validation code for the incoming xml.
    say i create another Schemadoc for the 2nd xml schema.
    something like this with another parameter(CHAR xsd1) passing to the method
    byte [] docbytes1 = xsd1.getBytes();
    ByteArrayInputStream in1 = new ByteArrayInputStream(docbytes1);
    XMLSchema schemadoc1 = (XMLSchema)builder.build(in1,null);
    DOMParser dp = new DOMParser();
    How to set for the 2nd xml schema validation in the above code or can i combine 2 xml schemas.
    How to go about it
    Rgrds
    Sushant

  • How to do schema validation with XSD_90200B Beta?

    Hi, I just downloaded xdk_java_9_0_2_0_0B.zip. And found that the size of xmlparserv2.jar and xschema.jar are significantly reduced. And if I replace them with the June version I had before, it does not do schema validation anymore.
    What other jar files do I need to do Schema Validation?
    Thank you very much!
    Yufei
    null

    The schema validation is in the xschema.jar.

  • BPMN 11g - Process initiation schema validation error

    Gurus,
    we are facing one absurd issue.
    When we create a BPMN process and expose it as a service in composite then the WSDL it creates automatically does not have 'formElementDefault' attribute under <xsd:schema > element..
    hence if we test from EM after enabling schema validation [composite-->reference->properties] then it show error....else it works fine randomly...sometimes work sometimes does not.... any clue.
    we have tried adding elementFormDefault="qualified" this but no luck. please suggest.
    <?xml version="1.0" encoding="UTF-8"?>
    <!--########################################################################################-->
    <!--#### ####-->
    <!--#### THIS IS AN AUTO GENERATED FILE. PLEASE DO NOT MANUALLY MODIFY ####-->
    <!--#### CHANGES TO THIS FILE MAY PRODUCE UNEXPECTED BEHAVIOR AND WOULD BE OVERWRITTEN ####-->
    <!--#### ####-->
    <!--########################################################################################-->
    <wsdl:definitions targetNamespace="http://xmlns.oracle.com/bpmn/bpmnProcess/Process" xmlns:tns="http://xmlns.oracle.com/bpmn/bpmnProcess/Process" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" >
    <wsdl:types>
    <xsd:schema targetNamespace="http://xmlns.oracle.com/bpmn/bpmnProcess/Process" added by me+_  elementFormDefault="qualified">
    <xsd:element name="operationCallbackResponse">
    <xsd:complexType>
    <xsd:sequence/>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="operation">
    <xsd:complexType>
    <xsd:sequence/>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </wsdl:types>
    Thanks,
    Biltu

    Please make sure that main xsd uses import or include tag to reference both schema1.xsd and schema2.xsd. If the main xsd does not do it, Pi cannot verify it. Since you package all the files as zip file, also make sure the path for the secondary files are in proper location.
    In short, the import element allows you to use schema components from any schema; the include element allows you to add all the components of an included schema to the containing schema. If the target namespace is same for both then include tag should be good enough. If you don't find one, you might have to use include tag element in the main or parent xsd file.
    Edited by: Baskar Gopal on Jan 31, 2012 5:18 PM

  • Adapter Engine XML Schema Validation Error Surpression

    We recently developed a number of web services that are called by 3rd parties outside our network. The web service request once made is picked up by a Web Dispatcher which then forwards the request to the de-central adapter. Both of these components reside within within a DMZ.
    We have, as an additional security measure made use of the new Adapter Engine XML Schema validation available with PI 7.1, to ensure that the payload of incomming messages is checked to ensure that it is a known structure.
    Now here is my problem, we recently had these services penetration tested by a 3rd party to ensure that they were secure and whilst the report was very good showing no major weaknesses they did pickup on a couple of items including that the fact that if the XSD to be used during payload message validation cannot be found an 'ADAPTER.JAVA_EXCEPTION' is returned to the web service consumer that highlights the path details of where the XSD should be (but could not be found).
    This was viewed as useful to an attacker for a number of reasons:
    1. Feedback in SQL injection attempts via verbatim DB error messages greatly improves attacker efficiency
    2. Path information is useful to the attacker for OS fingerprinting, directory traversal attempts
    3. Other miscellaneous stack trace information is useful to an attacker to understand how the application works
    Is there anyway this can be surpressed so that the adapter does not show this information in the returned error message - see example message below ?
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: Schema MaintenanceOrderByIDQuery_sync.xsd not found in E:\usr\sap\DPI\DVEBMGS40\j2ee\cluster\server0\validation\schema\f7cd3b50a87411e08830ed9d0af006a5\urnstw.contractor.wfm.workorderretrieval\MaintenanceOrderByIDQueryRequest_Out\httpsap.comxiSAPGlobal20~Global\MaintenanceOrderByIDQuery_sync.xsd  (validation\schema)
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1041)
         at sun.reflect.GeneratedMethodAccessor497.invoke(Unknown Source)
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: Schema Schema1.xsd not found in E:\usr\sap\DPI\DVEBMGS40\j2ee\cluster\server0\validation\schema\f7cd3b50a87411e08830ed9d0af006a5\urnstw.contractor.wfm.workorderretrieval\MaintenanceOrderByIDQueryRequest_Out\httpsap.comxiEA-APPLSEGlobal\Schema1.xsd  (validation\schema)
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1041)

    Hi,
    We are having the same problem, so you are not alone.
    I had an extensive call with Azure premium support and we where able to determine that:
    - Nothing is missing or in the wrong place in my exported .xml file.
    - Any changes to the VNET's using the web gui interface of https://manage.windowsazure.com is not possible when you have dns servers and use an gateway
    - You can download the .xml configuration file of the network and make manual changes to it, then import it again , to add/remove dns servers and or subnet's. 
    I am currently waiting for an solution,  i have let them lower the urgency from A to B (because i can make changes trough xml) and responded to the next support contact (saying he will continue with the issue) that the problems seems to be with azure and
    he should speak with the previous person helping me.  I have not heard from Azure support since.
    SR Number:115021812414226
    Open on:02/18/2015 09:28
    > There are networks with and without gateways created and the issue is happening on all the networks.
    > We are unable to add or remove the DNS servers. (by web gui)
    > Also not able to add or remove any subnets. (by web gui)
    > Every time the error message is same but the DNS server name is different. (from another subnet then the one we are changing)
    > Created CRI- 3405931, but they said it will need WATS team.
    > Confirmed with WATS engineer as well and moving case to WATS.
    > Cx agreed to lower the severity of the case as they are able to make changes through the network configuration file.
    > But they still want to get this resolved soon.
    > Agreed and dropped off, reducing severity to B 24/7.
    I hope microsoft is going to resolve this soon, as i do not want to edit my xml for little things like adding a subnet all the time. I have requested an status update in the issue.
    Should anyone have more information on this, please share it here.

  • Schema Validation using Adapter Engine : Error

    Hello Guys,
    For SOAP message coming into PI, I am doing schema validation by adapter engine but getting below error message
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: Schema Schema1.xsd not found in /usr/sap/PID/<Server>/j2ee/cluster/server1/validation/schema/af7c332075ce11e08e23ddce0a512253/urncompany.comcrmexternald2c/ServiceRequest_Out/urncompany.comcrm~enhancements/Schema1.xsd  (validation/schema)
    *     at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1178)*
    *     at sun.reflect.GeneratedMethodAccessor336.invoke(Unknown Source)*
    *     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)*
    *     at java.lang.reflect.Method.invoke(Method.java:585).........................*
    Here are some details
    -  Using standard SAP Message Type
    - Enhance data type
    - while exporting schema, there are 3 files in zip file
    1) mainschema (renamed it to MessageType name)
    2) Schema1.xsd
    3) Schema2.xsd
    I have followed the step according to below document
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d06dff94-9913-2b10-6f82-9717d9f83df1?QuickLink=index&overridelayout=true
    I have also checked schema1.xsd on PI server and File is there but still getting error.
    Any suggestions ?
    Thanks
    Edited by: chetan patel on Jan 31, 2012 10:50 PM

    Please make sure that main xsd uses import or include tag to reference both schema1.xsd and schema2.xsd. If the main xsd does not do it, Pi cannot verify it. Since you package all the files as zip file, also make sure the path for the secondary files are in proper location.
    In short, the import element allows you to use schema components from any schema; the include element allows you to add all the components of an included schema to the containing schema. If the target namespace is same for both then include tag should be good enough. If you don't find one, you might have to use include tag element in the main or parent xsd file.
    Edited by: Baskar Gopal on Jan 31, 2012 5:18 PM

  • How does XML DB handle XML Schema Validation ?

    In order to validate an XML document against an XML Schema using Oracle XML DB the XML Schema must first be registered with XML DB using the method registerSchema provided by the package DBMS_XMLSCHEMA.
    XDB provides two types of schema validation, 'Lax' Validation and 'Strict' Validation.
    'Lax' validation takes place whenever a schema based document is converted from it's textual representation into the XML DB internal object model. Errors caught by this validation will be prefixed with 'ORA'.
    'Stict' validation takes place when the XMLType methods schemaValidate() or isSchemaValid() are invoked.
    The schemaValidate() method throws an exception with an error message indicating what is wrong it encounteres an invalid document. The error message associated with the exception will be prefixed with LSX.
    The isSchemaValid() method returns true or false, depending on whether or not the document is valid. It cannot return any information about why the document is invalid.
    The reason for having both the Lax and Strict validation models is that Strict validation is much more expensive in terms of CPU and memory usage than Lax validation.

    Here are some examples of what is caught by Lax validation (ORA errors) and what is only caught by Strict validation (LSX errors).
    SQL> begin
      2     dbms_xmlschema.registerSchema('test',xmltype(
      3  '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.co
    eFormDefault="unqualified">
      4     <xs:complexType name="RootType">
      5             <xs:sequence>
      6                     <xs:element name="Mandatory"/>
      7                     <xs:element name="Enumeration">
      8                             <xs:simpleType>
      9                                     <xs:restriction base="xs:string">
    10                                             <xs:enumeration value="A"/>
    11                                             <xs:enumeration value="B"/>
    12                                             <xs:enumeration value="C"/>
    13                                     </xs:restriction>
    14                             </xs:simpleType>
    15                     </xs:element>
    16                     <xs:element name="MinLength">
    17                             <xs:simpleType>
    18                                     <xs:restriction base="xs:string">
    19                                             <xs:minLength value="4"/>
    20                                             <xs:maxLength value="20"/>
    21                                     </xs:restriction>
    22                             </xs:simpleType>
    23                     </xs:element>
    24                     <xs:element name="MaxLength">
    25                             <xs:simpleType>
    26                                     <xs:restriction base="xs:string">
    27                                             <xs:minLength value="1"/>
    28                                             <xs:maxLength value="4"/>
    29                                     </xs:restriction>
    30                             </xs:simpleType>
    31                     </xs:element>
    32                     <xs:element name="MaxOccurs" type="xs:string" maxOccurs="2"/>
    33                     <xs:element name="MinOccurs" minOccurs="2" maxOccurs="2"/>
    34                     <xs:element name="Optional" type="xs:string" minOccurs="0"/>
    35             </xs:sequence>
    36     </xs:complexType>
    37     <xs:element name="Root" type="RootType" xdb:defaultTable="ROOT_TABLE"/>
    38  </xs:schema>'));
    39  end;
    40  /
    PL/SQL procedure successfully completed.
    SQL> --
    SQL> -- Valid Document
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12  </Root>'
    13  ))
    14  /
    1 row created.
    SQL> --
    SQL> -- Undefined element 'Illegal'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Illegal>Hello World</Illegal>
      5     <Enumeration>A</Enumeration>
      6     <MinLength>ABCD</MinLength>
      7     <MaxLength>WXYZ</MaxLength>
      8     <MaxOccurs>1</MaxOccurs>
      9     <MaxOccurs>2</MaxOccurs>
    10     <MinOccurs>1</MinOccurs>
    11     <MinOccurs>2</MinOccurs>
    12     <Optional>Goodbye</Optional>
    13  </Root>'
    14  ))
    15  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-30937: No schema definition for 'Illegal' (namespace '##local') in parent
    '/Root'
    SQL> --
    SQL> -- Multiple occurences of 'Optional'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12     <Optional>Goodbye</Optional>
    13  </Root>'
    14  ))
    15  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-30936: Maximum number (1) of 'Optional' XML node elements exceeded
    SQL> --
    SQL> -- Missing element 'Manadatory'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Enumeration>A</Enumeration>
      4     <MinLength>ABCD</MinLength>
      5     <MaxLength>WXYZ</MaxLength>
      6     <MaxOccurs>1</MaxOccurs>
      7     <MaxOccurs>2</MaxOccurs>
      8     <MinOccurs>1</MinOccurs>
      9     <MinOccurs>2</MinOccurs>
    10     <Optional>Goodbye</Optional>
    11  </Root>'
    12  ))
    13  /
    1 row created.
    SQL> --
    SQL> -- Invalid Enumeration Value
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>Z</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12  </Root>'
    13  ))
    14  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-31038: Invalid enumeration value: "Z"
    SQL> --
    SQL> -- MinLength Violation
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABC</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12  </Root>'
    13  ))
    14  --
    15  -- MaxLength Violation
    16  --
    17  /
    1 row created.
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>VWXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12  </Root>'
    13  ))
    14  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-30951: Element or attribute at Xpath /Root/MaxLength exceeds maximum length
    SQL> --
    SQL> -- Missing element Optional - Valid Document
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11  </Root>'
    12  ))
    13  /
    1 row created.
    SQL> --
    SQL> -- Too many instances of 'MaxOccurs'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MaxOccurs>3</MaxOccurs>
    10     <MinOccurs>1</MinOccurs>
    11     <MinOccurs>2</MinOccurs>
    12     <Optional>Goodbye</Optional>
    13  </Root>'
    14  ))
    15  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-30936: Maximum number (2) of 'MaxOccurs' XML node elements exceeded
    SQL> --
    SQL> -- Too few instances of 'MinOccurs'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <Optional>Goodbye</Optional>
    11  </Root>'
    12  ))
    13  /
    1 row created.
    SQL> create trigger validateSchema
      2  before insert on ROOT_TABLE
      3  for each row
      4  begin
      5     :new.object_value.schemaValidate();
      6  end;
      7  /
    Trigger created.
    SQL> --
    SQL> -- Valid Document
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12  </Root>'
    13  ))
    14  /
    1 row created.
    SQL> --
    SQL> -- Undefined element 'Illegal'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Illegal>Hello World</Illegal>
      5     <Enumeration>A</Enumeration>
      6     <MinLength>ABCD</MinLength>
      7     <MaxLength>WXYZ</MaxLength>
      8     <MaxOccurs>1</MaxOccurs>
      9     <MaxOccurs>2</MaxOccurs>
    10     <MinOccurs>1</MinOccurs>
    11     <MinOccurs>2</MinOccurs>
    12     <Optional>Goodbye</Optional>
    13  </Root>'
    14  ))
    15  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-30937: No schema definition for 'Illegal' (namespace '##local') in parent
    '/Root'
    SQL> --
    SQL> -- Multiple occurences of 'Optional'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12     <Optional>Goodbye</Optional>
    13  </Root>'
    14  ))
    15  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-30936: Maximum number (1) of 'Optional' XML node elements exceeded
    SQL> --
    SQL> -- Missing element 'Manadatory'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Enumeration>A</Enumeration>
      4     <MinLength>ABCD</MinLength>
      5     <MaxLength>WXYZ</MaxLength>
      6     <MaxOccurs>1</MaxOccurs>
      7     <MaxOccurs>2</MaxOccurs>
      8     <MinOccurs>1</MinOccurs>
      9     <MinOccurs>2</MinOccurs>
    10     <Optional>Goodbye</Optional>
    11  </Root>'
    12  ))
    13  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00213: only 0 occurrences of particle "Mandatory", minimum is 1
    ORA-06512: at "SYS.XMLTYPE", line 345
    ORA-06512: at "XDBTEST.VALIDATESCHEMA", line 2
    ORA-04088: error during execution of trigger 'XDBTEST.VALIDATESCHEMA'
    SQL> --
    SQL> -- Invalid Enumeration Value
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>Z</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12  </Root>'
    13  ))
    14  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-31038: Invalid enumeration value: "Z"
    SQL> --
    SQL> -- MinLength Violation
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABC</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12  </Root>'
    13  ))
    14  --
    15  -- MaxLength Violation
    16  --
    17  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00221: "ABC" is too short (minimum length is 4)
    ORA-06512: at "SYS.XMLTYPE", line 345
    ORA-06512: at "XDBTEST.VALIDATESCHEMA", line 2
    ORA-04088: error during execution of trigger 'XDBTEST.VALIDATESCHEMA'
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>VWXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11     <Optional>Goodbye</Optional>
    12  </Root>'
    13  ))
    14  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-30951: Element or attribute at Xpath /Root/MaxLength exceeds maximum length
    SQL> --
    SQL> -- Missing element Optional - Valid Document
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <MinOccurs>2</MinOccurs>
    11  </Root>'
    12  ))
    13  /
    1 row created.
    SQL> --
    SQL> -- Too many instances of 'MaxOccurs'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MaxOccurs>3</MaxOccurs>
    10     <MinOccurs>1</MinOccurs>
    11     <MinOccurs>2</MinOccurs>
    12     <Optional>Goodbye</Optional>
    13  </Root>'
    14  ))
    15  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-30936: Maximum number (2) of 'MaxOccurs' XML node elements exceeded
    SQL> --
    SQL> -- Too few instances of 'MinOccurs'
    SQL> --
    SQL> insert into ROOT_TABLE values (xmltype(
      2  '<Root>
      3     <Mandatory>Hello World</Mandatory>
      4     <Enumeration>A</Enumeration>
      5     <MinLength>ABCD</MinLength>
      6     <MaxLength>WXYZ</MaxLength>
      7     <MaxOccurs>1</MaxOccurs>
      8     <MaxOccurs>2</MaxOccurs>
      9     <MinOccurs>1</MinOccurs>
    10     <Optional>Goodbye</Optional>
    11  </Root>'
    12  ))
    13  /
    insert into ROOT_TABLE values (xmltype(
    ERROR at line 1:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00213: only 1 occurrences of particle "MinOccurs", minimum is 2
    ORA-06512: at "SYS.XMLTYPE", line 345
    ORA-06512: at "XDBTEST.VALIDATESCHEMA", line 2
    ORA-04088: error during execution of trigger 'XDBTEST.VALIDATESCHEMA'
    SQL>

  • XML binary storage format impairs schema validation?

    I'm using Oracle 11g R1 on Windows Server 2003. I successfully registered schemas and created tables and indexes in the new binary storage format. However, when trying to load data, I'm running into problems. Schema validation behaves as if not the full feature set of XML Schema mysteriously isn't supported anymore.
    There is probably more but at least wildcard elements (xs:any) and element references (xs:element ref="STH") are simply ignored in the schema definition and data is rejected even when it conforms to the schema.
    Is there any solution for this or am I out of luck? I wanted to go back to CLOB storage as used in a previous installation but I'm running into problems when registering the schema. It complains about an empty SQL name although I don't have any defined. I'm pretty weirded out by all this.
    I created the schema and table in a straightforward way:
    begin
      dbms_xmlschema.registeruri(
        schemaurl => 'http://www.xxxhello.com/archive_tsd.xsd',
        schemadocuri => '/public/user/archive_tsd.xsd',
        gentypes => FALSE,
        options => DBMS_XMLSCHEMA.REGISTER_BINARYXML
    end;
    CREATE TABLE archive OF xmltype XMLTYPE STORE AS binary xml XMLSCHEMA
    "http://www.xxxhello.com/archive_tsd.xsd" ELEMENT "CompleteDocument";
    create index idx_lastmodified_archive on archive t
    (extractvalue(VALUE(t),'/CompleteDocument/DocContent/LastModified'));Because of xs:any or element references is ignored, I get errors like
    LSX-00213: only 0 occurrences of particle "REFDELEM", minimum is 1.
    Thanks for your help.

    The schema is very large (>200kb). Where should I upload it or can I send it to you? I'm bit concerned about confidentiality of company data. However, the instance is not valid yet. I'm in the process of modifying the schema to match all instances, but it breaks on places that should be already okay. No, I didn't use SchemaValidate ever.
    But I've made an example where at least xs:any doesn't work. Element references work, though.
    Sample schema:
    <?xml version = "1.0" encoding = "UTF-8"?>
    <xs:schema
      xmlns:tsd = "http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition"
      xmlns:xs = "http://www.w3.org/2001/XMLSchema">
      <xs:annotation>
        <xs:appinfo>
          <tsd:schemaInfo name = "sbreak">
            <tsd:collection name = "sbreak"></tsd:collection>
            <tsd:doctype name = "CompleteDocument">
              <tsd:logical>
                <tsd:content>open</tsd:content>
                <tsd:systemGeneratedIdentity reuse = "false"></tsd:systemGeneratedIdentity>
              </tsd:logical>
            </tsd:doctype>
            <tsd:adminInfo>
              <tsd:server>4.4.1.1</tsd:server>
              <tsd:modified>2007-07-03T16:00:46.484+02:00</tsd:modified>
              <tsd:created>2007-07-03T15:29:04.968+02:00</tsd:created>
              <tsd:version>TSD4.4</tsd:version>
            </tsd:adminInfo>
          </tsd:schemaInfo>
        </xs:appinfo>
      </xs:annotation>
      <xs:element name = "CompleteDocument">
        <xs:complexType>
          <xs:choice minOccurs = "0" maxOccurs = "unbounded">
            <xs:element name = "ComplexNormal">
              <xs:complexType>
                <xs:choice minOccurs = "0" maxOccurs = "unbounded">
                  <xs:element name = "NormalElem1" type = "xs:string"></xs:element>
                  <xs:element name = "NormalElem2" type = "xs:string"></xs:element>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name = "ComplexAny">
              <xs:complexType>
                <xs:choice minOccurs = "0" maxOccurs = "unbounded">
                  <xs:any minOccurs = "0" maxOccurs = "unbounded"></xs:any>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name = "ComplexRef">
              <xs:complexType>
                <xs:choice minOccurs = "0" maxOccurs = "unbounded">
                  <xs:element ref = "RefdElem"></xs:element>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name = "LastModified" type = "xs:string"></xs:element>
          </xs:choice>
        </xs:complexType>
      </xs:element>
      <xs:element name = "RefdElem">
        <xs:complexType>
          <xs:choice minOccurs = "0" maxOccurs = "unbounded">
            <xs:element name = "Elem1" type = "xs:string"></xs:element>
            <xs:element name = "Elem2" type = "xs:string"></xs:element>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:schema>Sample instance:
    <?xml version="1.0" encoding="UTF-8" ?>
    <CompleteDocument>
         <ComplexNormal>
              <NormalElem1>Test1</NormalElem1>
              <NormalElem2>Test2</NormalElem2>
         </ComplexNormal>
         <ComplexAny>
              <AnyElem>Test3</AnyElem>
         </ComplexAny>
         <ComplexRef>
              <RefdElem>
                   <Elem1>Test4</Elem1>
                   <Elem2>Test5</Elem2>
              </RefdElem>
         </ComplexRef>
    </CompleteDocument>Log of what I did. First I confirmed, that I could enter the instance using clob storage:
    SQL> begin
      2    dbms_xmlschema.registeruri(
      3      schemaurl => 'http://www.xxxhello.com/sbreak_tsd.xsd',
      4      schemadocuri => '/public/sbreak_tsd.xsd'
      5    );
      6  end;
      7  /
    PL/SQL-Prozedur erfolgreich abgeschlossen.
    SQL> CREATE TABLE sbreak OF xmltype XMLTYPE STORE AS clob XMLSCHEMA
    "http://www.xxxhello.com/sbreak_tsd.xsd" ELEMENT "CompleteDocument";
    Tabelle wurde erstellt.
    SQL> create index idx_lastmodified_sbreak on sbreak t (extractvalue(VALUE(t),
    '/CompleteDocument/LastModified'));
    Index wurde erstellt.
    SQL> insert into sbreak values(xmltype(bfilename('DATA', 'sbreak/sbreakinstance.xml'),
    NLS_CHARSET_ID('AL32UTF8')));
    1 Zeile wurde erstellt.Then I deleted table and schema again:
    SQL> drop index idx_lastmodified_sbreak;
    Index wurde gelöscht.
    SQL> drop table sbreak;
    Tabelle wurde gelöscht.
    SQL> begin
      2    dbms_xmlschema.deleteschema(
      3      schemaurl => 'http://www.xxxhello.com/sbreak_tsd.xsd'
      4     ,delete_option => dbms_xmlschema.delete_cascade_force
      5    );
      6  end;
      7  /
    PL/SQL-Prozedur erfolgreich abgeschlossen.After that I created schema and table with binary XML storage and tried to insert the same instance again:
    SQL> begin
      2    dbms_xmlschema.registeruri(
      3      schemaurl => 'http://www.xxxhello.com/sbreak_tsd.xsd',
      4      schemadocuri => '/public/sbreak_tsd.xsd',
      5      gentypes => FALSE,
      6      options => DBMS_XMLSCHEMA.REGISTER_BINARYXML
      7    );
      8  end;
      9  /
    PL/SQL-Prozedur erfolgreich abgeschlossen.
    SQL> CREATE TABLE sbreak OF xmltype XMLTYPE STORE AS binary xml XMLSCHEMA
    "http://www.xxxhello.com/sbreak_tsd.xsd" ELEMENT "CompleteDocument";
    Tabelle wurde erstellt.
    SQL> create index idx_lastmodified_sbreak on sbreak t (extractvalue(VALUE(t),
    '/CompleteDocument/LastModified'));
    Index wurde erstellt.
    SQL> insert into sbreak values(xmltype(bfilename('DATA', 'sbreak/sbreakinstance.xml'),
    NLS_CHARSET_ID('AL32UTF8')));
    insert into sbreak values(xmltype(bfilename('DATA', 'sbreak/sbreakinstance.xml'),
    NLS_CHARSET_ID('AL32UTF8')))
    FEHLER in Zeile 1:
    ORA-31011: XML-Parsing nicht erfolgreich
    ORA-19202: Fehler bei XML-Verarbeitung
    LSX-00021: undefined element "AnyElem"
    aufgetretenSorry about the non-english text, but I think it can be guessed easily what's going on. Next I'll try a modifed schema without the tsd namespace added by the schema editor I use (the original large schema has been migrated from the Tamino XML database).

  • Schema Validation Key/Keyref and substitutionGroup Problem

    First, thank you for fixing the schemaLocation problem.
    My next question is about key/keyref and substitution. If I define a key/keyref relationship inside one element, then use another element to substitute that element, I found that the key/keyref relationship is not preserved in the new element using oracle schema validation. I am not clear whether this is the correct behavior.
    For example:
    <element name="extended" type="xl:extendedType" abstract="true">
    <key name="labelKey">
    <selector xpath=".//[@xlink:type='locator']"/>
    <field xpath="@xlink:label"/>
    </key>
    <keyref name="labelKeyRef1" refer="self:labelKey">
    <selector xpath=".//*[@xlink:type='arc']"/>
    <field xpath="@xlink:from"/>
    </keyref>
    </element>
    <element name="calculationlink" type="xl:extendedType" substitutionGroup="xl:extended"/>
    The key/keyref is not validated inside calculationlink in this case.
    Yufei
    null

    Yufei,
    After we tested the schema location problem using the test case we produced, we can't find it has any problem. Would you send us the test data you have if you think it not works for you?
    I will check your keyref soon.

  • Schemas validation

    I'm using schema validation to validate XML instances.
    In case of error (constraint violation), I need to provide information back to the user about the problem such as :
    - value provided by the user,
    - constraint violated,
    - list of the facets of the object (min, max, nb of fractional digits, ...) and in addition, if possible, some (non native) attributes of the element.
    Example :
    Here is a complex type (part of o schema) describing the properties an element must match :
    <xsd:complexType name="hciRADIUS_ACC_THRES_T">
         <xsd:simpleContent>
              <xsd:restriction base="FloatDef_T">
                   <xsd:maxInclusive value="99.9"/>
                   <xsd:minInclusive value="1.0"/>
                   <xsd:fractionDigits value="1"/>
                   <xsd:attribute ref="label" fixed="Radius Acc Thres"/>
                   <xsd:attribute ref="continous" fixed="true"/>
                   <xsd:attribute name="precision" type="xsd:decimal" fixed="0.1"/>
              </xsd:restriction>
         </xsd:simpleContent>
    </xsd:complexType>
    Here is the corresponding element :
    <xsd:element name="hciRADIUS_ACC_THRES" type="hciRADIUS_ACC_THRES_T">
    When receiving the element "hciRADIUS_ACC_THRES" in an XML instance with value 120.33 for example :
    <hciRADIUS_ACC_THRES>120.33</hciRADIUS_ACC_THRES>
    I would like to retrieve information about the properties of the element type in order to send an error message back to the user, message which could be formatted as follow :
    Radius Acc Thres error[info contained in attribute "label"] : value 120.33
    Possible values : from 1.0[info contained in "minInclusive" facet] to 99.9[info contained in "maxInclusive" facet], number of fractional digits is 1[info contained in "fractionDigits" facet]...
    My questions are :
    - Is it possible to do that using a java SAX or DOM parser ? -> can anybody send me some code examples or tell me where to find them ?
    - Should I use DOM Level 3 API ?
    Thank you all

    Yes, I can use an ErrorHandler, but the ErrorHandler has a very poor content (only a standard message). I need much more information on the error such as the facets of the error node to give a complete message back to the user (min value, max value, nb of frcational digits, ...)
    Thank you.

  • Expression - Zip Code validation

    We have the field called Zip Code and this is a text field and 10 Chrs long.
    Field 1:  State
    Field u2018Stateu2019 is a lookup field and  the lookup table has Country, state code and state name.
    Field 2:  Zip Code
    Zip Code = text field and the length is 10 chrs.
    The ZIP Code Validation should be either NNNNN format (Block of 5 digits) for standard ZIP Code OR
    NNNNN-NNNN format (Block of 5 and 4  digits) for ZIP+4 format
    For example, if the country = US and state = IL then the first digit of the postal code field will be 6 then remaining 4 digits must be numeric for the standard 5 digit Zip code.
    Can anybody help me to write the expression. Full points will be rewarded.

    Hi,
    Try this it should work,
    For example, if the country = US and state = IL then the first digit of the postal code field will be 6 then remaining 4 digits must be numeric for the standard 5 digit Zip code.
    I am assuming here State = IL indicates state code = IL which is field in your Lookup table. As you said your Lookup table having fields Country, state code and state name
    IF(FIND(State.Country, "US") AND FIND(State.state code, "IL"), LEFT(Zip Code,1)=6 AND HAS_ALL_CHARS(RIGHT(Zip Code,4),0,9), FALSE)
    otherwise if your State having IL value is simple text field in maintable then replace it as
    IF(FIND(State.Country, "US") AND FIND(State, "IL"), LEFT(Zip Code,1)=6 AND HAS_ALL_CHARS(RIGHT(Zip Code,4),0,9), FALSE)
    Hope it will Help you,
    Rewards if Useful......
    Mandeep Saini

  • Possible to use SAX2 with schema validation

    I am trying to wade through various options on validation.
    Is it possible with the Oracle schema validation code to use SAX2 as the underlying parser? The example code with the 9.0 XDK uses DOM.

    Yes, you don't have to use DOM parser.
    DOM is only needed for validating Identity constraints that require the tree.

  • Can schema validation be activated for a process instance?

    Is there some configuration property that can be added to the bpel.xml that will turn on schema validation for a single process (as opposed to turning this on for the entire engine)?
    Cheers,
    -Dustin

    Hi Dustin ,
    You can also use the same property in bpel deployment descriptor's partnerLinkBinding, to enable/disable xml validation for a particular partner. "validateXML" property in bpel dd will override the domain.xml's "validateXML" property.
    For example in LoanFlow/bpel.xml, enable validation for only StarLoanService partner:
    <partnerLinkBinding name="StarLoanService">
    <property name="wsdlLocation"> http://<hostname>:9700/orabpel/default/StarLoan/StarLoan?wsdl
    </property>
    <property name="validateXML">true</property>
    </partnerLinkBinding>
    HTH.
    Thanks,
    Rakesh

  • Xmlparser_v2_1_0 beta - Schema validation

    I downloaded the beta java version of the xmlparser_v2_1_0.tar. In this version the classes for XSDBuilder and XMLSchema are not there. There is a class called XSDFactory however. The documentation that came with the download seems dated for it still contains the XSDBuilder and XSDSchema classes. Also the sample code contained no examples of how to use the XSDFactory class.
    I am trying to parse an XML doc using the SAXParser and want to validate it against a Schema. Am I using the right version of the XDK? Where are samples of schema validation located? I have looked through the Sample Code in the OTN pages and did not see any.

    Venator85 wrote:
    iphitus wrote:That said... to get that behaviour, add net-profiles and then net-auto to rc.conf, and change line 40 in /usr/bin/netcfg-wireless-auto from "netcfg2 $found" to "netcfg2 -c $found".
    Sorry, I was not meaning this. I was asking this because at home I have both wired and wireless connection, so the two profiles would be both activated, but I'd like to 'prioritize' the wired profile. I was thinking of letting net-profiles activate the wired profile but, if in case the cable was disconnected, to call net-auto to try the wireless. Note that the wireless should't be tried at all if the wired profile suceeds.
    This said, how do you test if any profile on any interface is active?
    Thanks for you help and your patience...
    Bye
    Oh, network priorities and heuristics of profiles is beyond netcfg, though I'm waiting for someone to write a really nice profile manager/autodetector that does all that
    An easy way to check is to use the functions in /usr/lib/network/network.subr under "Query". For example:
    source /usr/lib/network/network.subr
    if check_iface wlan0; then
    echo "oh no! a connected profile is using wlan0!"
    prof=$(get_iface_prof wlan0)
    echo "haha! The profile using it is: $prof"
    netcfg2 -d $prof
    else
    echo "yay wlan0 is free"
    fi
    if check_profile homewireless; then
    echo "/etc/network.d/homewireless is connected!!!"
    fi
    And there's a few more functions. You can also just check for file existance in /var/run/network/.. though the above are a bit easier. There's various useful wireless functions in /usr/lib/network/wireless.subr too... and some others in the other files.
    There's some cool stuff you can do with those functions. On my laptop, my xinitrc checks what network I'm connected to (check_profile). If i'm at uni, it starts up open office. If i'm at home, it'll start up pidgin.
    Last edited by iphitus (2008-06-28 10:11:12)

Maybe you are looking for