Validação do XML 2.0 no visualizador de NF-e da Sefaz Nacional retorna erro

Olá,
Gostaria de saber se alguém já verificou a estrutura do XML 2.0 gerados pelo SAP / GRC no visualizador de NFe do Portal Nacional, pois aqui na empresa estamos validando a estrutura destes XMLs e o visualizador retorna erro na estrutura e/ou conteúdo da NFe como não válidos.
O XML que estamos verificando, foi autorizado, pelas sefazes de São Paulo e Virtual de RS em ambiente de homologação.
Qualquer comentário é muito bem vindo.
Obrigada,
Luciana Kanno

Bom dia Luciana,
Conforme resposta completa pelo chamado, segue apenas para atualização da thread e informação aos amigos para ficarem "ligados" e nos ajudarem com esta investigação.
Os XML's que enviou são 100% corretos quanto a integridade de assinatura e schema, porém o programa rejeita sem explicar a causa.
A mensagem refere-se a erro de "estrutura e/ou conteúdo".
No caso estou apostando que neste software tem validações que nem mesmo as Secretarias implementaram como os erros que estão aparecendo aqui de 531.
Tente gerar a mesma nota (item + impostos) para outra Sefaz, quem sabe a rejeição escondida "aparece" em outro software de outra Sefaz.
Fora isso, contactar a produtora deste validador para entender que regra pode estar causando isto.
Atenciosamente, Fernando Da Ró

Similar Messages

  • Switching off validation when reading XML

    Is it possible to switch off the validation of an XML file when opening it in FrameMaker?
    I removed the public and system identifier from the Doctype declaration in the file (tried also removing the whole doctype declaration too) - and removed any reference to the DTD in the structured application definition. But when opening such an XML file, FrameMaker always displays a message dialog saying "Unable to validate because no DTD or Schema was specified in the XML file. Continue reading the file?". Is it possible to suppress this warning - I don't want it?
    Thanks for any suggestions.

    Franz,
    There should be no write-access issues. You do not need to use an external DTD. For example, if your original XML document is:
    <document>
      <title>My summer vacation</title>
      <paragraph purpose="summary">I had fun.</paragraph>
    </document>
    instead of changing it to:
    <!DOCTYPE document SYSTEM "onthefly.dtd">
    <document>
      <title>My summer vacation</title>
      <paragraph purpose="summary">I had fun.</paragraph>
    </document>
    generate:
    <!DOCTYPE document SYSTEM [
    <!ELEMENT document ANY>
    <!ELEMENT title ANY>
    <!ELEMENT paragraph ANY>>
    <!ATTLIST paragraph>
      purpose CDATA #IMPLIED>
    ]>
    <document>
      <title>My summer vacation</title>
      <paragraph purpose="summary">I had fun.</paragraph>
    </document>

  • XML validation using javax.xml.validation

    Hello,
    I am trying to validate some xml against my xsd.
    Here is my xml:
    <host>
        <status>Unknown</status>
    </host>Here is my xsd:
    <?xml version="1.0"?>
                                                                                                                                                                 <xsd:schema targetNamespace="blah"
            xmlns:tns="blah"
            xmlns:xsd="blah">
    <xsd:simpleType name="Status">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Unknown"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:element name="host">
       <xsd:complexType>
         <xsd:all>
           <xsd:element name="status" type="tns:Status"/>
         </xsd:all>
       </xsd:complexType>
    </xsd:element>
                                                                                                                                                                 </xsd:schema>My test code is:
            try
                DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document document = parser.parse(new File("test.xml"));
                // Create a SchemaFactory capable of understanding WXS schemas.
                SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                // Load a WXS schema, represented by a Schema instance.
                StreamSource schemaFile = new StreamSource(new File("schema.xsd"));
                Schema schema = factory.newSchema(schemaFile);
                // Create a Validator object, which can be used to validate the document
                Validator validator = schema.newValidator();
                // Validate the DOM tree.
                validator.validate(new DOMSource(document));
            catch(Exception e)
                fail("XML validation failed: " + e.getMessage());
            }I get the following error:
    ERROR: 'cvc-elt.1: Cannot find the declaration of element 'host'.'
    If i replace "type=tns:Status' in the "status" element with just "type=string", it works fine.
    Does anyone have any idea what the problem is?
    Thank you,
    David

    To daft_davy:
    1. Your XSD document is invalid: the xmlns attribute of schema documents must always have the following value: "http://www.w3.org/2001/XMLSchema"
    All other values will result in the following validation error:
    org.xml.sax.SAXParseException: s4s-elt-schema-ns: The namespace of element 'schema' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
    Your XSD should look like this:
    <?xml version="1.0"?>
    <xsd:schema targetNamespace="blah" xmlns:tns="blah" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:simpleType name="Status">
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="Unknown"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:element name="host">
        <xsd:complexType>
          <xsd:all>
            <xsd:element name="status" type="tns:Status"/>
          </xsd:all>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>2. Your XML document does not match the XSD schema (even if you use the one above) for the following reasons:
    a) The root element of the XML document must be associated with the namespace defined by the targetNamespace attribute of the schema.
    b) The "blah" namespace at the element <status> in the XML document has to be undeclared because there is no namespace declaration to this element in the schema document either. There are to ways to do this:
    <host xmlns="blah">
      <status xmlns="">Unknown</status>
    </host>or:
    <xxx:host xmlns:xxx="blah">
      <status>Unknown</status>
    </xxx:host>
    To watertownjordan:
    The namespace URI can be virtually any string, so you don't need to specify a valid URI to define a namespace.

  • Validation of an XML

    Hi guys,
    Basically i need to do a validation on an XML file to determine if the XML is well formed and do a schema validation. I have code that does this and but my real problem is fatal errors. the code below is a sample of what i have done. Every time i get a fatal error eg a start node does not match an end node etc the function drops out and i dont get any more errors.
    What i really am using this for is to tell users the errors they have made to an XML file that they are submitting to me and as you might imagine what i have is fairly useless because as soon as i get a fatal errror booom no more error details.
    Can someone please suggest a way that i can get past these types of errors and continue producing a report for my users.
    thanks in advance.
    import java.io.IOException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.helpers.XMLReaderFactory;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import java.io.StringReader;
    import java.io.FileReader;
    import java.io.BufferedReader;
    public class SchemaValidate {
    public static void main(String[] args) {
         String parserClass = "org.apache.xerces.parsers.SAXParser";
         String validationFeature
              = "http://xml.org/sax/features/validation";
         String schemaFeature
              = "http://apache.org/xml/features/validation/schema";
         try {
              StringBuffer sBuffer = new StringBuffer();
    String str;
    BufferedReader in = new BufferedReader(new FileReader("dictionary.xml"));
    while ((str = in.readLine()) != null) {
         //System.out.println(str);
         sBuffer.append(str + "\n");
              XMLReader r = XMLReaderFactory.createXMLReader(parserClass);
              r.setFeature(validationFeature,true);
              r.setFeature(schemaFeature,true);
              r.setErrorHandler(new MyErrorHandler());
              r.parse("dictionary.xml");
              System.out.println("Warning: ");          
         } catch (SAXException e) {
              System.out.println(e.toString());
         } catch (IOException e) {
              System.out.println(e.toString());
    private static class MyErrorHandler extends DefaultHandler {
    public void warning(SAXParseException e) throws SAXParseException {
         System.out.println("Warning: ");
         printInfo(e);
    public void error(SAXParseException e) throws SAXParseException {
         System.out.println("Error: ");
         printInfo(e);
    public void fatalError(SAXParseException e) throws SAXParseException {
         System.out.println("Fattal error: ");
         printInfo(e);
    private void printInfo(SAXParseException e) {
         System.out.println("\n Public ID: "+e.getPublicId());
         System.out.println("\n System ID: "+e.getSystemId());
         System.out.println("\n Line number: "+e.getLineNumber());
         System.out.println("\n Column number: "+e.getColumnNumber());
         System.out.println("\n Message: "+e.getMessage() + "\n");

    I see you problem but the strictness of XML is essential. One has learned from of HTML - each browser trying to fix and show the stuff in spite of, say, invalid tags. To blow up at the first error is a compliant (and maybe desired?) behaviour.

  • XML Validation: ignore non-XML-Header in XML-file(payload): any solutions?

    Dear Experts,
    after I finally managed to configure the XML Validation, we're facing the next problem:
    The payload of the XML files looks like that:
    Abcdef#ABCDEF
    AbcDef#123
    <?xml version="1.0" encoding="UTF-8"?><Document xmlns.....
    as you can see, there's a header which is necessary. The XML Validation works fine if the header is removed manually for testing. If the header is not removed, the validation is not possible ("Content is not allowed in prolog.")
    Is it possible to realise the validation WITH that header? Can I tell SAP PI to ignore the header? Or make any changes to the XSD file?
    Thanks alot!

    Hi Armin,
    Armin Kern wrote:
    > After leaving SAP PI, those 2 lines have to be in that exact place (before the XML part) for further processing. Just deleting it wouldn't be enought. Does the complex design you mentioned complay with this requirement?
    You can put it into the message instead of deleting. And rebuild the "header" in the second step. So you can fullfill the requirement. As mentioned before: The design is complex, this will lead later on to problems. Any change will be difficult, as another developer had to read a long documentation.
    An alternative would be to do all with one interface mapping (without validation):
    1. ABAP / Java mapping deleting the "header" (put it to memory)
    2. Messges Mapping 1:1 each field (will fail in case of wrong format and act as validator)
    3. ABAP / Java mapping restoring the header
    4. Alert will be raised in case of an error (to get the result of the validation)
    Armin Kern wrote:
    > I also thought about splitting the message, deleting those 2 rows in one of the messages, sending this one message to PI again, validate it and if it is correct, send the second message (without mapping) to the final destination. No idea if that is possible at all..
    As well possible. You would need a virtual receiver for the first message, which is sending back a response. For example a servlett, a proxy or a RFC module. In that design you put some logic to the sender, what is actually not bad. But if you do so, why you dont validate there as well (for example with Java)? It would make your design much easier..
    Regards,
    Udo

  • Xsd validation of an xml.. another program...

    hiii......this is another program ..........
    please see the problem with the code..
    package com.pgs.tma;
    import java.io.*;
    import javax.xml.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import java.io.IOException;
    import org.w3c.dom.Document;
    import org.xml.sax.SAXException;
    public class valid {
         static final String JAXP_SCHEMA_SOURCE =
                        "http://java.sun.com/xml/jaxp/properties/schemaSource";
         public static void main(String args[]) throws IOException, SAXException, ParserConfigurationException
         if(args.length < 2)
                             System.err.println("usage is:");
                             System.err.println(" java -jar tips.jar -validatedom "
                                                      + "xml.xml xsd.xsd");
                             return;
         System.out.println(args[0]);
         System.out.println(args[1]);
         File input = new File(args[0]),
                             schema = new File(args[1]);
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setNamespaceAware(true);
              factory.setValidating(true);
         System.out.println("1");
         try{
              System.out.println("2");
              factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
    "http://www.w3.org/2001/XMLSchema");
              System.out.println("3");
              factory.setAttribute(JAXP_SCHEMA_SOURCE,"C://TWWorkspace//TMA//input//schema.xsd");
    //     factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",schema);
         System.out.println("4");
         catch(IllegalArgumentException x)
                   System.out.println("5");
                   System.err.println(" DOM parser is not JAXP 1.2 compliant"+x);
         System.out.println("6");
         Document doc = null;
         try{       
              DocumentBuilder parser = factory.newDocumentBuilder();
              //factory.setErrorHandler( myErrorHandler );
              doc = parser.parse(input);
              System.out.println("7");
         catch (ParserConfigurationException e){
              System.out.println("Parser not configured: " + e.getMessage());
         catch (SAXException e){
              System.out.print("Parsing XML failed due to a " + e.getClass().getName() + ":");
              System.out.println(e.getMessage());
         catch (IOException e){
              e.printStackTrace();
         System.out.println("end of program");
    the error message is:
    C:\TWWorkspace\TMA\input\input.xml
    C:\TWWorkspace\TMA\input\schema.xsd
    1
    2
    3
    5
    DOM parser is not JAXP 1.2 compliantjava.lang.IllegalArgumentException: http://java.sun.com/xml/jaxp/properties/schemaSource
    6
    Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
    set, which is probably not what is desired. Parser will use a default
    ErrorHandler to print the first 10 errors. Please call
    the 'setErrorHandler' method to fix this.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=3: cvc-elt.1: Cannot find the declaration of element 'shiporder'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=4: cvc-elt.1: Cannot find the declaration of element 'orderperson'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=5: cvc-elt.1: Cannot find the declaration of element 'shipto'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=6: cvc-elt.1: Cannot find the declaration of element 'name'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=7: cvc-elt.1: Cannot find the declaration of element 'address'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=8: cvc-elt.1: Cannot find the declaration of element 'city'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=9: cvc-elt.1: Cannot find the declaration of element 'country'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=11: cvc-elt.1: Cannot find the declaration of element 'item'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=12: cvc-elt.1: Cannot find the declaration of element 'title'.
    Error: URI=file:C:/TWWorkspace/TMA/input/input.xml Line=13: cvc-elt.1: Cannot find the declaration of element 'note'.
    7
    end of program

    I see you problem but the strictness of XML is essential. One has learned from of HTML - each browser trying to fix and show the stuff in spite of, say, invalid tags. To blow up at the first error is a compliant (and maybe desired?) behaviour.

  • Pulling validation pattern from XML schema in LCD

    Hi team,
    We have deisgned a fillable PDF form uding Live Cycle Designer ES2.
    The form contains fields of different data types.
    We have created a data connection on the form (using LCD) to bind it to a XML Schema
    The XML schema has different types of validations for different data types.
    When we treid to bind the XML schema to PDF form using LCD, most of the validations were pulled in. Example, numeric lenghth check, string length check, minoccurs , maxoccurs
    But few validations were not pulled from Schema like Pattern validations on string.
    Please guide us on how to achieve this using LiveCycle Designer ES2.
    Cheers,
    Kavi

    Hi Kavi,
    The pattern from the XML Schema can not be automatically copied across, I assume because of the differences in the XML Schema pattern regex and a JavaScript regex.  If you did use a compatible subset I you could write a macro to add the pattern to the validation event.  One difference is a XML Schema pattern always assumes a ^  and $ to match the beginning and end.  Have you seen this document http://partners.adobe.com/public/developer/en/livecycle/lc_designer_XML_schemas.pdf,
    Regards
    Bruce

  • Xsd validation of an xml...

    hii......
    please see the problem in the code or suggest me a code for this....
    package com.pgs.tma;
    import org.apache.xerces.parsers.DOMParser;
    import java.io.File;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import java.io.*;
    class try3 {
    String xmlFile = "";
    String xsdFile = "";
    //constructor declaration
    try3(String xmlFile, String xsdFile) {
              this.xmlFile = xmlFile;
    this.xsdFile = xsdFile;
    public void process() {
         //System.out.println("5");
    File docFile = new File(xmlFile);
    //System.out.println("6");
    try {
         System.out.println("7");
    DOMParser parser = new DOMParser();
    parser.setFeature("http://xml.org/sax/features/validation", true);
    parser.setFeature("http://apache.org/xml/features/validation/schema", true);
    parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
    xsdFile);
    System.out.println("8");
    ErrorChecker errors = new ErrorChecker();
    parser.setErrorHandler(errors);
    parser.parse(docFile.toString());
    } catch (Exception e) {
    System.out.print("Problem parsing the file.");
    System.out.println("Error: " + e);
    class ErrorChecker extends DefaultHandler {
    public void error(SAXParseException e) throws SAXException {
    System.out.println( "Line " + e.getLineNumber() + "..." );
    System.out.println( e.getMessage() );
    System.out.println();
    public class try3demo {
         public static void main (String args[]) {
         for (int i = 0; i < args.length; i++) {
              System.out.println("1");
         switch (i) {
         case 0 :
         System.out.println("XML File=" + args);
         break;
         case 1 :
         System.out.println("XSD File=" + args);
         break;
         default :
         System.out.println("Unknown=" + args);
         break;
         System.out.println("2");
         if (args.length != 2) {
         System.err.println("Usage: <xml file> <xsd file>");
         System.exit(1);
         System.out.println("3");
         try3 testXml = new try3(args[0], args[1]);
         System.out.println("4");
         testXml.process();
         System.out.println("4");
    i am using java 1.4....
    this is the error message i got..
    1
    XML File=[Ljava.lang.String;@4b2d01fa
    1
    XSD File=[Ljava.lang.String;@4b2d01fa
    2
    3
    java.lang.VerifyError: (class: com/pgs/tma/try3, method: process signature: ()V) Incompatible object argument for method call
         at com.pgs.tma.try3demo.main(try3demo.java:69)
    Exception in thread "main"

    The cause of the error is there being three maxOccurs attributes set to "9999" in the schema. All you can do is to change "9999" to a lesser value or "unbounded". This is a bug in J2SE, which is unlikely to be fixed in the foreseeable future.

  • Xform validation by using Xml-schema

    Hello,
    I want to validate XForm by using XForm Schema. In an xform example attached below , there are two input fields zip and zip2.
    I am not getting why zip in xform attached below cannot be validated.But zip2 is working fine. I am using mozilla firefox browser.
    XForm and XMLSchema is attached below.
    XForm is
    <?xml version="1.0" encoding="UTF-8"?>
    <html
       xmlns="http://www.w3.org/1999/xhtml"
       xmlns:xf="http://www.w3.org/2002/xforms"
       xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:ftype="http://www.example.com/my-file-types">
       <head>
          <title>Validate Postal Codes</title>
          <style type="text/css">
             @namespace xf url("http://www.w3.org/2002/xforms");
             xf|input {
                display: table-row;
                line-height: 2em;
             xf|label {
                display: table-cell;
                text-align: right;
                font-family: Arial, Helvetica, sans-serif;;
                font-weight: bold;
                padding-right: 5px;
                width: 150px;
             *:required {
                 background-color: yellow;
             *:invalid  {
                background-color: pink;
          </style>
          <xf:model schema="schema.xsd">
             <xf:instance>
    <data xmlns="http://www.example.com/my-file-types">
    <zip/>
    <zip2/>
    </data>
    </xf:instance>
             <xf:bind id="zip" required="true()" type="ftype:zipType" nodeset="ftype:zip" />
             <xf:bind id="zip2" required="true()" type="ftype:zip2Type" nodeset="ftype:zip2" />
          </xf:model>
       </head>
       <body>
          <xf:input bind="zip" incremental="true">
             <xf:label>Zip Code: </xf:label>
             <xf:hint>Validation is not correctly specified for this field</xf:hint>
             <xf:alert>The 'Zip Code' failed to validate!</xf:alert>
          </xf:input>
          <xf:input bind="zip2" incremental="true">
             <xf:label>Zip Code 2: </xf:label>
             <xf:hint>Validation is correctly specified for this field</xf:hint>
             <xf:alert>
               <xf:output value="concat('The &quot;', name(), '&quot; failed to validate!')" />
             </xf:alert>
          </xf:input>
       </body>
    </html>--------------------------------------------------------------------------------
    And XML Schema is
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ftype="http://www.example.com/my-file-types" targetNamespace="http://www.example.com/my-file-types" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="data">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="zipType">
                             <xs:simpleType id="zipType">
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="b"/>
                                       <xs:enumeration value="computer"/>
                                       <!-- bad pattern: matches any sequence of 5 digits, even if there are more digits or non-numeric. -->
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:simpleType name="zip2Type">
              <xs:restriction base="xs:string">
                   <xs:pattern value="^\d{2}$"/>
                   <!-- good pattern: matches only 2 digits, nothing extra -->
              </xs:restriction>
         </xs:simpleType>
    </xs:schema>Looking for some reply.
    Best Regards
    Tabbasum

    Hi Otto,
                 The form data output directly send to the PI system via Email.
    But we change the interface field names closer to PI requirement.
    Thanks for your response.
    I am closing this thread.
    Cheers
    Sam

  • Struts / Validator: ErrorMessages from xml-file? How?

    Hi there,
    Ive added the Validator PlugIn to my Struts project.
    The Problem is: all my messages are stored in xml-files.
    Now I want to store my error messages for the Validator in its own xml.
    Can someone tell me how to tell struts to look into the xml instead of the .properties file?
    thanks guys

    Hi there,
    Ive added the Validator PlugIn to my Struts project.
    The Problem is: all my messages are stored in xml-files.
    Now I want to store my error messages for the Validator in its own xml.
    Can someone tell me how to tell struts to look into the xml instead of the .properties file?
    thanks guys

  • Validating data in XML file

    Hi gang ..
    Just got a project (unfished) which I have to parse & validate an xml document .. the work to be done is as follows:
    1. Gather xml
    2. Parse data
    3. Validate data
    4. Insert data into db
    5. Send message back to browser
    I'm not sure what's the best way to go about accomplishing this in a productive way utilizing all that's out there.
    Any help would be appreciated.  (xml file is enclosed)
    Netpagino

    Thanks for the reply TLC-IT ..
    I agree on not reinventing the wheel .. I'd much rather start the project from beginning instead of what I have in front of me now ..
    I will work to get as best of a result as I can ..
    So for the sake of making sure I have the process correctly, what steps would you follow on the following scenario which is the basis for
    this project ..
    1. User submits request via web app to get latest list of information
    2. Web app makes a call for xml data to be processed: validated against business rules (data type, not nulls, etc)
    3. Upon successful validation a message is sent back to app with success message
    4. Upon errors found a message is sent back to app with errors
    Alternatively .. I will work on some sort of validation for this, however I can't think of a way to validate the data which comes from an xml file & looks to be loaded into an array ..
    Thanks ..

  • Validation of bdmconfig.xml. Urgent!

    Hello,
    When I use the command : java weblogic.wtc.gwt.WTCValidateCF bdmconfig.xml
    I receive the following message :
    E:\bea\wlserver6.0\config\StecardDom>e:/bea/jdk130/bin/java -classpath e:/bea/jd
    k130/lib/jatmi.jar;e:/bea/wlserver6.0/lib/weblogic.jar;e:/bea/jdk130/lib/tools.j
    ar;e:/bea/wlserver6.0/config/StecardDom/applications/stecard/Web-inf/classes web
    logic.wtc.gwt.WTCValidateCF bdmconfig.xml Validating Config file bdmconfig.xml...
    ERROR: Can not create TDMResources object, reason(java.lang.NullPointerException
    )! ERROR: Could not complete processing of element T_DM_RESOURCES ERROR: Failed to
    extract the config attributes. ERROR: Validation failed for configuration XML file!
    Here is my bdmconfig.xml (I have just remove IP addresses):
    <?xml version="1.0"?>
    <!DOCTYPE BDMCONFIG SYSTEM "..\..\..\wtc1.0\weblogic\wtc\gwt\wtc_config_1_0.dtd">
    <!--Java and XML-->
    <WTC_CONFIG>
    <BDMCONFIG>
         <T_DM_LOCAL_TDOMAIN AccessPoint="WTC">
              <WlsClusterName>Coolio</WlsClusterName>
              <AccessPointId>WTC</AccessPointId>
              <Type>TDOMAIN</Type>
              <Security>NONE</Security>
              <Interoperate>yes</Interoperate>
              <NWAddr>//10.6.12.116:7001</NWAddr>
         </T_DM_LOCAL_TDOMAIN>
         <T_DM_REMOTE_TDOMAIN AccessPoint="B_GATE">
              <LocalAccessPoint>WTC</LocalAccessPoint>
              <AccessPointId>B_GATE</AccessPointId>
              <Type>TDOMAIN</Type>
              <NWAddr>//190.0.0.2:20000</NWAddr>
         </T_DM_REMOTE_TDOMAIN>
         <T_DM_IMPORT
              ResourceName="Padm_ihm"
              LocalAccessPoint="WTC"
              RemoteAccessPointList="B_GATE">
              <TranTime>600</TranTime>
         </T_DM_IMPORT>
         <T_DM_RESOURCES>
              <FieldTables>
              <FldTblClass Type="fml16">stecard.uti.IhmFMLTable</FldTblClass>
              </FieldTables>
         </T_DM_RESOURCES>
    </BDMCONFIG>
    </WTC_CONFIG>
    I try without validate my bdmconfig.xml and when I start WLS I receive this message
    Improperly formated config file : .\config\StecardDom\bdmconfig.xml
    Thanks for your help.
    (Excuse me for my english I am french)

    I already use WTCStartup and with debug I receive the following message :
    <10 juil. 02 11:09:14 CEST> <Info> <WebLogicServer> <Invoking startup class: web
    logic.wtc.gwt.WTCStartup.startup(BDMCONFIG=.\config\StecardDom\bdmconfig.xml,Tra
    ceLevel=100000)>
    <10 juil. 02 11:09:14 CEST> <Info> <WTC> <Start loading the config file: .\confi
    g\StecardDom\bdmconfig.xml>
    <10 juil. 02 11:09:14 CEST> <Debug> <WTC> <[/WTCStartup/loadFile/>
    <10 juil. 02 11:09:14 CEST> <Error> <WTC> <Improperly formated config file .\con
    fig\StecardDom\bdmconfig.xml>
    <10 juil. 02 11:09:14 CEST> <Debug> <WTC> <]/WTCStartup/loadFile/50/void>
    <10 juil. 02 11:09:14 CEST> <Info> <WebLogicServer> <weblogic.wtc.gwt.WTCStartup
    reports: null>
    Thanks for help.
    Bob Finan <[email protected]> wrote:
    Hello Martin,
    The validation failure is a problem in the WTCValidateCF utility
    and a fix may be available from customer support.
    The "Improperly formatted" error message is a little confusing
    because it indicates you are using an early version than the
    WTCValidateCF was available in(or maybe even FieldTables)
    If you are running with the service pack 2 for WLS 6.0, the latest,
    then it could be that you need to transition from the older version
    of startup/shutdown classes to the newer versions.
    (eg OatmialStartup/OatmialShutdown=>WTCStartup/WTCShutdown).
    You may try turning on tracing, set the TraceLevel argument for
    the startup class, and the additional debug info in the WLS log should
    help with narrowing down the problem.
    Bob Finan
    Martin Erwan wrote:
    Hello,
    When I use the command : java weblogic.wtc.gwt.WTCValidateCF bdmconfig.xml
    I receive the following message :
    E:\bea\wlserver6.0\config\StecardDom>e:/bea/jdk130/bin/java -classpathe:/bea/jd
    k130/lib/jatmi.jar;e:/bea/wlserver6.0/lib/weblogic.jar;e:/bea/jdk130/lib/tools.j
    ar;e:/bea/wlserver6.0/config/StecardDom/applications/stecard/Web-inf/classesweb
    logic.wtc.gwt.WTCValidateCF bdmconfig.xml Validating Config file bdmconfig.xml...
    ERROR: Can not create TDMResources object, reason(java.lang.NullPointerException
    )! ERROR: Could not complete processing of element T_DM_RESOURCES ERROR:Failed to
    extract the config attributes. ERROR: Validation failed for configurationXML file!
    Here is my bdmconfig.xml (I have just remove IP addresses):
    <?xml version="1.0"?>
    <!DOCTYPE BDMCONFIG SYSTEM "..\..\..\wtc1.0\weblogic\wtc\gwt\wtc_config_1_0.dtd">
    <!--Java and XML-->
    <WTC_CONFIG>
    <BDMCONFIG>
    <T_DM_LOCAL_TDOMAIN AccessPoint="WTC">
    <WlsClusterName>Coolio</WlsClusterName>
    <AccessPointId>WTC</AccessPointId>
    <Type>TDOMAIN</Type>
    <Security>NONE</Security>
    <Interoperate>yes</Interoperate>
    <NWAddr>//10.6.12.116:7001</NWAddr>
    </T_DM_LOCAL_TDOMAIN>
    <T_DM_REMOTE_TDOMAIN AccessPoint="B_GATE">
    <LocalAccessPoint>WTC</LocalAccessPoint>
    <AccessPointId>B_GATE</AccessPointId>
    <Type>TDOMAIN</Type>
    <NWAddr>//190.0.0.2:20000</NWAddr>
    </T_DM_REMOTE_TDOMAIN>
    <T_DM_IMPORT
    ResourceName="Padm_ihm"
    LocalAccessPoint="WTC"
    RemoteAccessPointList="B_GATE">
    <TranTime>600</TranTime>
    </T_DM_IMPORT>
    <T_DM_RESOURCES>
    <FieldTables>
    <FldTblClass Type="fml16">stecard.uti.IhmFMLTable</FldTblClass>
    </FieldTables>
    </T_DM_RESOURCES>
    </BDMCONFIG>
    </WTC_CONFIG>
    I try without validate my bdmconfig.xml and when I start WLS I receivethis message
    Improperly formated config file : .\config\StecardDom\bdmconfig.xml
    Thanks for your help.
    (Excuse me for my english I am french)

  • [11g] XML Schema full validation with binary XML ?

    Hi,
    Oracle's doc quotes " Loading XML data into XML schema-based binary XML storage causes full validation against the target XML schemas. ".
    After registering this XML Schema which indicates that a company must have at least a code, name and pilotes element :
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xdb="http://xmlns.oracle.com/xdb"
    xdb:storeVarrayAsTable="true" version="1.0">
    <xsd:element name="compagnie" type="compagnieType"/>
    <xsd:complexType name="compagnieType">
    <xsd:sequence>
    <xsd:element name="comp" type="compType" minOccurs="1" xdb:SQLName="COMP"/>
    <xsd:element name="pilotes" type="pilotesType" minOccurs="1" xdb:SQLName="PILOTES"/>
    <xsd:element name="nomComp" type="nomCompType" minOccurs="1" xdb:SQLName="NOMCOMP"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="pilotesType">
    <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="unbounded"
    name="pilote" type="piloteType" xdb:SQLName="PILOTE"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="piloteType">
    <xsd:sequence>
    <xsd:element name="nom" type="nomType" xdb:SQLName="NOM"/>
    <xsd:element name="salaire" type="salaireType" minOccurs="0"
         xdb:SQLName="SALAIRE"/>
    </xsd:sequence>
    <xsd:attribute name="brevet" xdb:SQLName="BREVET">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:minLength value="1"/>
    <xsd:maxLength value="4"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:attribute>
    </xsd:complexType>
    I can therefore insert a row no valid into this table
    CREATE TABLE compagnie_binaryXML_grammaire OF XMLType
    XMLTYPE STORE AS BINARY XML
    XMLSCHEMA "http://www.soutou.net/compagnies3.xsd"
    ELEMENT "compagnie"
    ALLOW NONSCHEMA
    VIRTUAL COLUMNS (vircolcomp AS (EXTRACTVALUE(OBJECT_VALUE,'/compagnie/comp')));
    SQL> INSERT INTO compagnie_binaryXML_grammaire VALUES
    2 (XMLTYPE.CREATEXML('<?xml version="1.0" encoding="ISO-8859-1"?>
    3 <compagnie>
    4 <pilotes></pilotes>
    5 <nomComp>No pilot and no comp!</nomComp>
    6 </compagnie>').CREATESCHEMABASEDXML('http://www.soutou.net/compagnies3.xsd'
    1 ligne crÚÚe.
    Unless the following instruction is done, no valid XML file can be added.
    ALTER TABLE compagnie_binaryXML_grammaire
         ADD CONSTRAINT valide_compagniebinaryXML
         CHECK (XMLIsValid(OBJECT_VALUE) = 1);
    Where is the difference between the behaviour of an object-relational table ?

    My guess is that the virtual column spoils the soup (could you check).
    The following works for me on 11.1.0.6.0.
    connect / as sysdba
    drop user test cascade;
    create user test identified by test;
    grant xdbadmin, dba to test;
    connect test/test
    spool encoding_test01.txt
    var schemaPath varchar2(256)
    var schemaURL  varchar2(256)
    set long 100000000
    col SCHEMA_URL FOR a60
    col object_name for a50
    select * from v$version;
    purge recyclebin;
    alter session set recyclebin=OFF;
    drop table VALIDATE_XML_SCHEMA;
    prompt  Create Folder for TEST schema, user
    declare
       retb boolean;
    begin
      retb := dbms_xdb.createfolder('/test');
    end;
    prompt  =================================================================
    prompt  Register Relational XML SChema
    prompt  =================================================================
    prompt  XML SChema
    begin
      :schemaURL  := 'http://www.relational.com/root.xsd';
      :schemaPath := '/test/root_relational.xsd';
    end;
    prompt  Cleaning up
    call  DBMS_XMLSCHEMA.deleteSchema(:schemaURL,4);
    commit;
    prompt  XSD Schema
    declare
      res boolean;
      xmlSchema xmlType := xmlType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xdb="http://xmlns.oracle.com/xdb"
                xmlns="http://www.relational.com/root.xsd" targetNamespace="http://www.relational.com/root.xsd"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified"
                xdb:storeVarrayAsTable="true">
         <xs:element name="ROOT" xdb:defaultTable="ROOT_TABLE" xdb:maintainDOM="false">
              <xs:annotation>
                   <xs:documentation>Example XML Schema</xs:documentation>
              </xs:annotation>
              <xs:complexType xdb:maintainDOM="false">
                   <xs:sequence>
                        <xs:element name="ID" type="xs:integer" xdb:SQLName="ID"/>
                        <xs:element ref="INFO"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="INFO" xdb:SQLName="INFO_TYPE">
              <xs:complexType xdb:maintainDOM="false">
                   <xs:sequence>
                        <xs:element name="INFO_ID" type="xs:integer" xdb:SQLName="TYPE_INFO_ID"/>
                        <xs:element name="INFO_CONTENT"
                    xdb:SQLName="TYPE_INFO_CONTENT" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>');
    begin
    if (dbms_xdb.existsResource(:schemaPath)) then
        dbms_xdb.deleteResource(:schemaPath);
    end if;
    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    end;
    alter session set events='31098 trace name context forever';
    BEGIN
      DBMS_XMLSCHEMA.registerSchema
      (SCHEMAURL => :schemaURL,
      SCHEMADOC => xdbURIType(:schemaPath).getClob(),
      LOCAL     => TRUE,   -- local
      GENTYPES  => FALSE,  -- generate object types
      GENBEAN   => FALSE,  -- no java beans
      GENTABLES => FALSE,  -- generate object tables
      OWNER     => USER);
    END;
    commit;
    prompt  =================================================================
    prompt  Register Binary XML SChema
    prompt  =================================================================
    prompt  XML SChema
    begin
      :schemaURL  := 'http://www.binary.com/root.xsd';
      :schemaPath := '/test/root_binary.xsd';
    end;
    prompt  Cleaning up
    call  DBMS_XMLSCHEMA.deleteSchema(:schemaURL,4);
    commit;
    prompt  XSD Schema
    declare
      res boolean;
      xmlSchema xmlType := xmlType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xdb="http://xmlns.oracle.com/xdb"
                xmlns="http://www.binary.com/root.xsd" targetNamespace="http://www.binary.com/root.xsd"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified"
                xdb:storeVarrayAsTable="true">
         <xs:element name="ROOT" xdb:defaultTable="ROOT_TABLE" xdb:maintainDOM="false">
              <xs:annotation>
                   <xs:documentation>Example XML Schema</xs:documentation>
              </xs:annotation>
              <xs:complexType xdb:maintainDOM="false">
                   <xs:sequence>
                        <xs:element name="ID" type="xs:integer" xdb:SQLName="ID"/>
                        <xs:element ref="INFO"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="INFO" xdb:SQLName="INFO_TYPE">
              <xs:complexType xdb:maintainDOM="false">
                   <xs:sequence>
                        <xs:element name="INFO_ID" type="xs:integer" xdb:SQLName="TYPE_INFO_ID"/>
                        <xs:element name="INFO_CONTENT"
                    xdb:SQLName="TYPE_INFO_CONTENT" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>');
    begin
    if (dbms_xdb.existsResource(:schemaPath)) then
        dbms_xdb.deleteResource(:schemaPath);
    end if;
    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    end;
    alter session set events='31098 trace name context forever';
    BEGIN
      DBMS_XMLSCHEMA.registerSchema
      (SCHEMAURL => :schemaURL,
      SCHEMADOC => xdbURIType(:schemaPath).getClob(),
      LOCAL     => TRUE,   -- local
      GENTYPES  => FALSE,  -- generate object types
      GENBEAN   => FALSE,  -- no java beans
      GENTABLES => FALSE,  -- generate object tables
      OPTIONS   => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
      OWNER     => USER);
    END;
    commit;
    prompt  =================================================================
    prompt  Register SECOND Binary XML SChema
    prompt  =================================================================
    prompt  XML SChema
    begin
      :schemaURL  := 'http://www.different.com/roots.xsd';
      :schemaPath := '/test/roots.xsd';
    end;
    prompt  Cleaning up
    call  DBMS_XMLSCHEMA.deleteSchema(:schemaURL,4);
    commit;
    prompt  XSD Schema
    declare
      res boolean;
      xmlSchema xmlType := xmlType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xdb="http://xmlns.oracle.com/xdb"
                xmlns="http://www.different.com/roots.xsd" targetNamespace="http://www.different.com/roots.xsd"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified"
                xdb:storeVarrayAsTable="true">
         <xs:element name="ROOTS" xdb:maintainDOM="false">
              <xs:annotation>
                   <xs:documentation>Example XML Schema</xs:documentation>
              </xs:annotation>
              <xs:complexType xdb:maintainDOM="false">
                   <xs:sequence>
                        <xs:element name="ID" type="xs:integer" xdb:SQLName="ID"/>
                        <xs:element ref="INFO"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="INFO" xdb:SQLName="INFO_TYPE">
              <xs:complexType xdb:maintainDOM="false">
                   <xs:sequence>
                        <xs:element name="INFO_ID" type="xs:integer" xdb:SQLName="TYPE_INFO_ID"/>
                        <xs:element name="INFO_CONTENT"
                    xdb:SQLName="TYPE_INFO_CONTENT" type="xs:string"/>
                   </xs:sequence>          </xs:complexType>
         </xs:element>
    </xs:schema>');
    begin
    if (dbms_xdb.existsResource(:schemaPath)) then
        dbms_xdb.deleteResource(:schemaPath);
    end if;
    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    end;
    alter session set events='31098 trace name context forever';
    BEGIN
      DBMS_XMLSCHEMA.registerSchema
      (SCHEMAURL => :schemaURL,
      SCHEMADOC => xdbURIType(:schemaPath).getClob(),
      LOCAL     => TRUE,   -- local
      GENTYPES  => FALSE,  -- generate object types
      GENBEAN   => FALSE,  -- no java beans
      GENTABLES => FALSE,  -- generate object tables
      OPTIONS   => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
      OWNER     => USER);
    END;
    commit;
    prompt  =================================================================
    prompt  END Registration Process
    prompt  =================================================================
    select xmlType(xdbURIType ('/test/root.xsd').getClob())
    from   dual;
    alter session set events='31098 trace name context forever';
    select schema_url, binary
    from   user_xml_schemas;
    select * from tab;
    select object_name, object_type from user_objects;
    prompt  =================================================================
    prompt  BASICFILE - XMLSCHEMA (default) - DISALLOW NONSCHEMA
    prompt  =================================================================
    drop table "VALIDATE_XML_SCHEMA";
    create table "VALIDATE_XML_SCHEMA" of XMLTYPE
    XMLTYPE STORE AS BASICFILE BINARY XML
    XMLSCHEMA "http://www.binary.com/root.xsd"
      ELEMENT "ROOT";
    prompt  No schema defined
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT>
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  Bogus, noexistent schema defined
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.bogus.com/root.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  Binary schema defined
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.binary.com/root.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  Binary schema with different location path
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOTS xmlns="http://www.different.com/roots.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOTS>'))
    prompt  Binary schema with incorrect "root(s)"
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.different.com/roots.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  Relational registered schema
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.relational.com/root.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  =================================================================
    prompt  BASICFILE - XMLSCHEMA - ALLOW NONSCHEMA
    prompt  =================================================================
    drop table "VALIDATE_XML_SCHEMA";
    create table "VALIDATE_XML_SCHEMA" of XMLTYPE
    XMLTYPE STORE AS BASICFILE BINARY XML
    XMLSCHEMA "http://www.binary.com/root.xsd"
      ELEMENT "ROOT"
    ALLOW NONSCHEMA;
    prompt  No schema defined
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT>
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  Bogus, noexistent schema defined
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.bogus.com/root.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  Binary schema defined
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.binary.com/root.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  Binary schema with different location path
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOTS xmlns="http://www.different.com/roots.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOTS>'))
    prompt  Binary schema with incorrect "root(s)"
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.different.com/roots.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    prompt  Relational registered schema
    insert into "VALIDATE_XML_SCHEMA"
    values
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.relational.com/root.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>'))
    -- Output
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE     11.1.0.6.0     Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    5 rows selected.
    Recyclebin purged.
    Session altered.
    drop table VALIDATE_XML_SCHEMA
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Create Folder for TEST schema, user
    declare
    ERROR at line 1:
    ORA-31003: Parent / already contains child entry test
    ORA-06512: at "XDB.DBMS_XDB", line 316
    ORA-06512: at line 4
    =================================================================
    Register Relational XML SChema
    =================================================================
    XML SChema
    PL/SQL procedure successfully completed.
    Cleaning up
    call  DBMS_XMLSCHEMA.deleteSchema(:schemaURL,4)
    ERROR at line 1:
    ORA-31000: Resource 'http://www.relational.com/root.xsd' is not an XDB schema document
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 106
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 102
    ORA-06512: at line 1
    Commit complete.
    XSD Schema
    PL/SQL procedure successfully completed.
    Session altered.
    PL/SQL procedure successfully completed.
    Commit complete.
    =================================================================
    Register Binary XML SChema
    =================================================================
    XML SChema
    PL/SQL procedure successfully completed.
    Cleaning up
    call  DBMS_XMLSCHEMA.deleteSchema(:schemaURL,4)
    ERROR at line 1:
    ORA-31000: Resource 'http://www.binary.com/root.xsd' is not an XDB schema document
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 106
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 102
    ORA-06512: at line 1
    Commit complete.
    XSD Schema
    PL/SQL procedure successfully completed.
    Session altered.
    PL/SQL procedure successfully completed.
    Commit complete.
    =================================================================
    Register SECOND Binary XML SChema
    =================================================================
    XML SChema
    PL/SQL procedure successfully completed.
    Cleaning up
    call  DBMS_XMLSCHEMA.deleteSchema(:schemaURL,4)
    ERROR at line 1:
    ORA-31000: Resource 'http://www.different.com/roots.xsd' is not an XDB schema document
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 106
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 102
    ORA-06512: at line 1
    Commit complete.
    XSD Schema
    PL/SQL procedure successfully completed.
    Session altered.
    PL/SQL procedure successfully completed.
    Commit complete.
    =================================================================
    END Registration Process
    =================================================================
    Session altered.
    SCHEMA_URL                                                   BIN
    http://www.relational.com/root.xsd                           NO
    http://www.binary.com/root.xsd                               YES
    http://www.different.com/roots.xsd                           YES
    3 rows selected.
    no rows selected
    no rows selected
    =================================================================
    BASICFILE - XMLSCHEMA (default) - DISALLOW NONSCHEMA
    =================================================================
    drop table "VALIDATE_XML_SCHEMA"
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Table created.
    No schema defined
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    ERROR at line 3:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LSX-00021: undefined element "ROOT"
    Bogus, noexistent schema defined
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    ERROR at line 3:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LSX-00023: unknown namespace URI "http://www.bogus.com/root.xsd"
    Binary schema defined
    1 row created.
    Binary schema with different location path
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    ERROR at line 3:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LSX-00023: unknown namespace URI "http://www.different.com/roots.xsd"
    Binary schema with incorrect "root(s)"
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    ERROR at line 3:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LSX-00023: unknown namespace URI "http://www.different.com/roots.xsd"
    Relational registered schema
    (xmltype('<?xml version="1.0" encoding="UTF-8"?>
    ERROR at line 3:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LSX-00023: unknown namespace URI "http://www.relational.com/root.xsd"
    =================================================================
    BASICFILE - XMLSCHEMA - ALLOW NONSCHEMA
    =================================================================
    Table dropped.
    Table created.
    No schema defined
    1 row created.
    Bogus, noexistent schema defined
    1 row created.
    Binary schema defined
    1 row created.
    Binary schema with different location path
    1 row created.
    Binary schema with incorrect "root(s)"
    1 row created.
    Relational registered schema
    1 row created.

  • Validation of a XML file

    I have tried to validate an XML file using SAXBuilder
    String file = "C:\\DataXMLFile.xml";
    SAXBuilder builder = new SAXBuilder(true);
    try {
    builder.build(file);
    System.out.println(file + " is well formed.");
    catch (JDOMException e) { // indicates a well-formedness or validity error
    System.out.println(file + " is not valid.");
    System.out.println(e.getMessage());
    I got an error message, even though the XML file is valid using XMLSpy.
    C:\DataXMLFile.xml is not valid.
    Error on line 2 of document file:///C:/DataXMLFile.xml: Element type "Beispiel" must be declared.
    Element "Beispiel" has been declared in the schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <xsd:element name="Beispiel">
              <xsd:complexType>
    <xsd:attribute name="version" type="xsd:string" fixed="1.0"/>
              </xsd:complexType>
         </xsd:element>
    </xsd:schema>
    Could someone help me to solve this problem.
    Thanks a lot
    butterfly

    I have been having similar problems, and I just had a breakthrough.
    dvohra09 was correct by the way, though to give more information:
    "new SAXBuilder(true);" mean validate with DTD. Instead, do this:
    SAXBuilder builder =
    new SAXBuilder("org.apache.xerces.parsers.SAXParser", true);
    builder.setFeature(
    "http://apache.org/xml/features/validation/schema", true);
    In you XML file, give the path to the schema definition like this:
    <?xml version = "1.0" ?>
    <Customer
    xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation = "test/Customer.xsd">
    <FirstName2>Raymond</FirstName2>
    where "test/Customer.xsd" is the location in the CLASSPATH of the xsd. Then you will be fine. When it says "Element type "Beispiel" must be declared", that means that it is not finding the schema... When you stop getting this message, it means that either it is not validating, or that the schema is being found successfully.
    Regards,
    Chris

  • Validating a Dom XML tree

    Is there a solution to validate a XML document represented by a DOM Document ?
    The class DocumentBuilder let us validate a XML document but only when parsing XML file and not a DOM tree.
    In my program, I build an XML document using DOM (Node.appendChild(), ...); and I'd like, after having built it, to validate it. How can I do ?
    Thank's.

    Serialize it to some output format, making sure you include a reference to the DTD you want to validate against. Then read that output back into a validating parser.

Maybe you are looking for

  • How can I tell if a String is a double?

    How can I tell if a certain String represents a double value? I'm sure it's something very simple, but I can't find it... for example, String s = "45.432"...

  • Problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2

    Hi experts, I'm getting problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2. I have a scenario where is defined the document type ZC1, document part 200, authorization group 0002 and for all of these  documents the storage cate

  • Flash Builder 4.6 Mac Creative Suite Install Experience Went Ok

    Just wanted to post having successfully installed FB 4.6 on Mac. System Macbook Pro OS 10.6.8 CS5 MasterSuite plus CS5.5 Master Suite on top of that. Cannot remember why I still have both but it had to do with a complimentary upgrade due to purchase

  • Soap LookupService with Decentralized Adapter Engine

    Hi Experts, I would like to use a Decentralized adapter engine with the Lookup Service on PI 7.1 , but when try to use that, it doesn't work, because Lookup Service is default configure to use Central adapter only. I would like how to set a decentral

  • Bytes is greater than maxbytes in dba_data_files

    Hi, In what situation can the size of bytes be greater than the size of maxbytes in the dba_data_files? select bytes,user_bytes,maxbytes from dba_data_files where bytes > maxbytes BYTES     USER_BYTES     MAXBYTES 10485760000     10485694464     6392