Schema validation problem

I am validating an XML document using an XML Schema.
I tested my valadation program out on my computer (Window 2000) and everything seem to be going well.
When i deploy my application (stand-alone) onto another desktop (through Terminal Service...I receive the following error message:
SAXException: cvc-elt.1: Cannot find the declaration of element 'Book'.
I also display the xml string to see what's wrong with th exml string....but couldn't find anything.:
<Book><Title>Hello World</Title><AUTHOR>Anom.</AUTHOR></Book>
The error states that the xml document does not start with (or does not contains th e) Book element..which it does. I'm confused at what could have cause this error message. Since this error cannot be reproduce at my computer.

fixed the problem. i should have listen to you in the first place.
the schema file was not found on the other machine..there was some relative path issues (where the application was started [working directory]). apparently..the application started in a different directory..so th epath relative to the current directory is different than the where i start the app on my computer.

Similar Messages

  • 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

  • Schema validation problem in oracle 11g

    Hi,
    I am facing the following problem.
    The Issue.xsd contains two elements (element1, element2) described as below. It contains two types
    1. simpleType - MyStringType
    2. complexType - MyType, an extension of MyStringType
    Oracle XML DB can able to validate element2(simpleType), but not element1(complexType).
    ---------------------Issue.xsd File ------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="ConfigRoot" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="ConfigRoot" elementFormDefault="qualified">
         <xsd:element name="ConfigRoot" xdb:defaultTable="CONFIG_TBL_ISSUE">
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element name="element1" type="MyType"/>
                        <xsd:element name="element2" type="MyStringType"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:simpleType name="MyStringType">
              <xsd:restriction base="xsd:string">
                   <xsd:pattern value="\d{2}([\W])\d{2}([\W])\d{2}"/>
              </xsd:restriction>
         </xsd:simpleType>
         <xsd:complexType name="MyType">
              <xsd:simpleContent>
                   <xsd:extension base="MyStringType">
                        <xsd:attribute name="id" type="xsd:integer"/>
                   </xsd:extension>
              </xsd:simpleContent>
         </xsd:complexType>
    </xsd:schema>
    --------------------- XML File -----------------
    <?xml version="1.0" encoding="UTF-8"?>
    <ConfigRoot xsi:schemaLocation="ConfigRoot Issue.xsd" xmlns="ConfigRoot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <element1 id="1">19-12-222</element1>
         <element2>19-12-555</element2>
    </ConfigRoot>
    Though the schema is registered as binary, oracle could not able to validate the element1. The XML gets properly validated in the XML editors.

    "Issue.xsd"
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="ConfigRoot" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="ConfigRoot" elementFormDefault="qualified">
    <xsd:element name="ConfigRoot" xdb:defaultTable="CONFIG_TBL_ISSUE">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="element1" type="MyType"/>
    <xsd:element name="element2" type="MyStringType"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:simpleType name="MyStringType">
    <xsd:restriction base="xsd:string">
    <xsd:pattern value="\d{2}(\W)\d{2}(\W)\d{2}"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="MyType">
    <xsd:simpleContent>
    <xsd:extension base="MyStringType">
    <xsd:attribute name="id" type="xsd:integer"/>
    </xsd:extension>
    </xsd:simpleContent>
    </xsd:complexType>
    </xsd:schema>
    "Issue.xml"
    <?xml version="1.0" encoding="UTF-8"?>
    <ConfigRoot xsi:schemaLocation="ConfigRoot Issue.xsd" xmlns="ConfigRoot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <element1 id="1">19-12-222</element1>
    <element2>19-12-555</element2>
    </ConfigRoot>
    [oracle@srv01-18-102 20081010]$ sqlplus / as sysdba
    SQL*Plus: Release 11.1.0.7.0 - Production on Fri Oct 10 14:46:09 2008
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    SQL> create user otn identified by otn account unlock;
    User created.
    SQL> -- The Quick and Dirty way regarding granting privileges
    SQL> grant dba, xdbadmin  to otn;
    Grant succeeded.
    SQL> connect otn/otn
    Connected.
    SQL> create directory "XMLDIR_SCHEMA" as '/home/oracle/OTN/20081010';
    Directory created.
    SQL> -- Issue.xsd and Issue.xml are created and copied to the directory /home/oracle/OTN/20081010, on which I have read, write access as Linux user "oracle" (the oracle software owner)
    SQL> BEGIN
      2  DBMS_XMLSCHEMA.registerSchema(
      3  SCHEMAURL => 'Issue.xsd',
      4  SCHEMADOC => bfilename ('XMLDIR_SCHEMA', 'Issue.xsd'),
      5  GENTYPES => FALSE,
      6  OWNER => USER,
      7  OPTIONS => 3);
      8  end;
      9* /
    PL/SQL procedure successfully completed.
    SQL> select * from tab;
    TNAME                          TABTYPE  CLUSTERID
    CONFIG_TBL_ISSUE               TABLE
    SQL> set long 100000000
    SQL> desc "CONFIG_TBL_ISSUE"
    Name                                      Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "Issue.xsd" Element "ConfigRoot") STORAGE BINARY
    SQL> set pages 5000
    SQL>  select dbms_metadata.get_ddl('TABLE','CONFIG_TBL_ISSUE',user) from dual;
    DBMS_METADATA.GET_DDL('TABLE','CONFIG_TBL_ISSUE',USER)
      CREATE TABLE "OTN"."CONFIG_TBL_ISSUE" OF "SYS"."XMLTYPE"
      XMLTYPE STORE AS BASICFILE BINARY XML  (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10  
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS  1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
    XMLSCHEMA "Issue.xsd" ELEMENT "ConfigRoot" ID 4768 DISALLOW NONSCHEMA PCTFREE 10
      PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    INSERT INTO "CONFIG_TBL_ISSUE"
    VALUES
    (XMLTYPE(bfilename('XMLDIR_SCHEMA','Issue.xml'),NLS_CHARSET_ID('AL32UTF8')));
    SQL> INSERT INTO "CONFIG_TBL_ISSUE"
      2  VALUES
      3  (XMLTYPE(bfilename('XMLDIR_SCHEMA','Issue.xml'),NLS_CHARSET_ID('AL32UTF8')))
      4  ;
    (XMLTYPE(bfilename('XMLDIR_SCHEMA','Issue.xml'),NLS_CHARSET_ID('AL32UTF8')))
    ERROR at line 3:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LSX-00333: literal "19-12-555" is not valid with respect to the pattern
    SQL> -- TESTING EXCEPTIONS
    SQL> INSERT INTO "CONFIG_TBL_ISSUE"
      2  VALUES
      3  (XMLTYPE(
      4   '<?xml version="1.0" encoding="UTF-8"?>
      5   <ConfigRoot xsi:schemaLocation="ConfigRoot Issue.xsd" xmlns="ConfigRoot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      6   <element1 id="1">01-11-11</element1>
      7   <element2>02-11-11</element2>
      8   </ConfigRoot>
      9  '));
    1 row created.
    SQL> rollback;
    Rollback complete.
    SQL> -- ELEMENT 1 and 2 ARE WRONG (correct response)
    SQL> INSERT INTO "CONFIG_TBL_ISSUE"
      2  VALUES
      3  (XMLTYPE(
      4   '<?xml version="1.0" encoding="UTF-8"?>
      5   <ConfigRoot xsi:schemaLocation="ConfigRoot Issue.xsd" xmlns="ConfigRoot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      6   <element1 id="1">01-11-111</element1>
      7   <element2>02-11-111</element2>
      8   </ConfigRoot>
      9  '));
    (XMLTYPE(
    ERROR at line 3:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LSX-00333: literal "02-11-111" is not valid with respect to the pattern
    SQL> -- ELEMENT 1 is WRONG (OOPS)
    SQL> INSERT INTO "CONFIG_TBL_ISSUE"
      2  VALUES
      3  (XMLTYPE(
      4   '<?xml version="1.0" encoding="UTF-8"?>
      5   <ConfigRoot xsi:schemaLocation="ConfigRoot Issue.xsd" xmlns="ConfigRoot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      6   <element1 id="1">01-11-111</element1>
      7   <element2>02-11-11</element2>
      8   </ConfigRoot>
      9  '));
    1 row created.
    SQL> rollback;
    Rollback complete.
    SQL> -- ELEMENT 2 is WRONG (correct response)
    SQL> SQL> INSERT INTO "CONFIG_TBL_ISSUE"
      2  VALUES
      3  (XMLTYPE(
      4   '<?xml version="1.0" encoding="UTF-8"?>
      5   <ConfigRoot xsi:schemaLocation="ConfigRoot Issue.xsd" xmlns="ConfigRoot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      6   <element1 id="1">01-11-11</element1>
      7   <element2>02-11-111</element2>
      8   </ConfigRoot>
      9  '));
    INSERT INTO "CONFIG_TBL_ISSUE"
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LSX-00333: literal "02-11-111" is not valid with respect to the patternIt looks like if, if I interpret the XML schema correctly, that it doesn't comply to the extension "myStringType" of the restriction base "MyType". I am not absolutely sure if this is correct behavior or not, because of the nesting. If it should comply to the extend and therefore also should comply to the restriction pattern then this would mean that you discovered a bug.
    If it is a bug or not, I think you should create a service request for this, asking Oracle Support for help.
    Grz
    Marco

  • Schema validation problems

    Dear all,
    I am developing a EJB as the adapter module for the data validaion of the sender message on XI.
    Because of the limit of accessing external website I can't implement the validation by parsing the payload
    against the external XSD.
    Therefore I am trying to implement the validation by parsing the payload against the internal DTD instead of the external XSD or the external DTD.
    Please advise me how to convert the external XSD as the internal DTD into the payload before the
    payload is parsed.
    Thanks & Regards,
    Red

    Also you can find sample code on the site below.
    Please eliminate unused code and then use it.
    Also do the required System property setting which is already there in the code.
    (And do clear it after setting & using the system property)
    http://knowhowsapxi.synthasite.com/modules-in-sap-xi.php
    PS: The code is using SAX mapping to create the required source structure in message mapping of XI
    Edited by: Progirl Progirl on Nov 26, 2008 4:43 PM

  • Problem in SAX XSD schema validator

    hi
    I've tried this code to validate XML using xsd file:
    public static void validate(String xmlFilePath, URL schemaFileUrl)
            try
                SAXParserFactory factory = SAXParserFactory.newInstance();
                factory.setValidating(false);// stop standard validation to allow
                                                // custom schema
                factory.setNamespaceAware(true);
                SchemaFactory schemaFactory = SchemaFactory
                        .newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
                factory.setSchema(schemaFactory.newSchema(schemaFileUrl));
                SAXParser parser = factory.newSAXParser();
                XMLReader reader = parser.getXMLReader();
                // Register the error handler
                reader.setErrorHandler(new JS_ValidationError());
                // Parse the file as the first argument on the command-line
                reader.parse(xmlFilePath);
            catch (SAXException e)
                System.out.println("Error: " + e.getMessage());
                e.printStackTrace();
            } catch (IOException e)
                System.out.println("Error: " + e.getMessage());
                e.printStackTrace();
            } catch (ParserConfigurationException e)
                // TODO Auto-generated catch block
                e.printStackTrace();
        } I have called this method ,but it issues this error :"unknown protocol" followed by windows partition name, in the debug I found that the value of the url is "*file://(*windows-partiton-char)/rest of path" !!!
    this should work but it doesn't!!
    so how can I fix this problem?
    thanks

    someone sent me this code to fix,it works:
    package schemaValidationPackage;
    * XsdSchemaSaxValidator.java
    * Copyright (c) 2007 by Dr. Herong Yang. All rights reserved.
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Schema;
    import javax.xml.XMLConstants;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.transform.sax.SAXSource;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import javax.xml.validation.Validator;
    import java.io.*;
    import java.net.URL;
    //also thanks for developer Hind Abd-El-Khalek
    public class XsdSchemaSaxValidator {
         public static void validate(String xmlFilePath, URL schemaFileUrl)
            try
                SAXParserFactory factory = SAXParserFactory.newInstance();
                factory.setValidating(false);// stop standard validation to allow
                                                // custom schema
                factory.setNamespaceAware(true);
                SchemaFactory schemaFactory = SchemaFactory
                        .newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
                factory.setSchema(schemaFactory.newSchema(schemaFileUrl));
                SAXParser parser = factory.newSAXParser();
                XMLReader reader = parser.getXMLReader();
                // Register the error handler
                reader.setErrorHandler(new JS_ValidationError());
                // Parse the file as the first argument on the command-line
                reader.parse(xmlFilePath);
            catch (SAXException e)
                System.out.println("Error: " + e.getMessage());
                e.printStackTrace();
            } catch (IOException e)
                System.out.println("Error: " + e.getMessage());
                e.printStackTrace();
            } catch (ParserConfigurationException e)
                // TODO Auto-generated catch block
                e.printStackTrace();
      public static void validateXml(Schema schema, String xmlName) {
        try {
          // creating a Validator instance
          Validator validator = schema.newValidator();
          // preparing the XML file as a SAX source
          SAXSource source = new SAXSource(
            new InputSource(new java.io.FileInputStream(xmlName)));
          // validating the SAX source against the schema
          validator.validate(source);
          System.out.println();
          System.out.println("Validation passed.");
        } catch (Exception e) {
          // catching all validation exceptions
          System.out.println();
          System.out.println(e.toString());
      public static Schema loadSchema(String name) {
        Schema schema = null;
        try {
          String language = XMLConstants.W3C_XML_SCHEMA_NS_URI;
          SchemaFactory factory = SchemaFactory.newInstance(language);
          schema = factory.newSchema(new File(name));
        } catch (Exception e) {
          System.out.println(e.toString());
        return schema;
    }

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

  • Problem when attribute fails schema validation

    I have got a problem during schema validation... let's say i have the following record:
    <employee ssn="123456789D" recordNum="10">
    <lastName>Bloggs</lastName>
    <firstName>Joe</firstName>
    <address>123 America Ave</address>
    </employee>
    apparently the attribute ssn will fail the schema, since ssn has to be all digit and length 9. Currently my schema vaildation process will keep on going to the next record if the current one fails, and write the current bad record to a error log file. the problem i have found is that if the ssn attribute validation fails, then there is no way for me to obtain the value of recordNum attribute (all elements can still be obtained).
    just wondering if anyone had similar problem...
    thanks

    My understanding of schmemas was that once an error is found the whole document is considered invalid. Kind of like if the XML file format is bad.
    If you don't mind me asking are you using DocumentBuilder to parse and is it giving you a SAXParseException?

  • BPM Problem: Schema validation error notification

    Hello all,
    When a schema validation error takes place upon receiving XML messages via HTTP, is there something that can be set up in BPM to notify data owners? (either alert or email)
    Regards,
    Steve

    Bhavesh,
    <i>When you mean source schema validation, does it imply that you want to validate your Source XML before graphical mapping to make sure it meets the Source XML Schema?</i>
    validate my Source XML
    <i>As you pointed out you are usinga BPM, you can wrap the Transfromation step with a Exception handling block, so when there is a mismatch of Source schema and ite actual message the exception handler will be invoked and in the exception handler you can trigger alerts using the control step.</i>
    I'm using an outbound interface (outside BPM) to call the abstract interface (very first step in BPM), and there's a tranformation step after that. 
    -If the Source schema is wrong, will the error take place at the outbound interface or at the transformation step?  If outside at the outbound interface, i wouldn't be able to wrap anything around it.
    -Exception handling block means the BLOCK step?
    Regards,
    Steve

  • DTD/ schema validation and XSLT

    Hi
    I want to do mappings from IDoc to CIDX messages. The first choice was to do XSLT mappings. But because we need DTD/schema validation we switched to Graphical mapping.
    But mapping idocs to cidx messages with graphical mapping is proving to be a difficult job with all the context problems.
    Is it possible to combine the advantages of both mapping techniques in the following way.
    Define 1 interface mapping with 2 message mappings in it:
    - The first 'source to target' with XSLT.
    - The second 'target to target' with Graphical mapping (only connecting the top node) so we can have DTD/Schema validation.
    Kind regards
    Thierry

    hi,
    Source - XSLT - Target1
    Target1 - GM - Target2
    If what I understand is correct,in your INTERFACE MAPPING , then your Source Interafce will point to messagetype of typr SOURCE and Destination Interface will point to message type TARGET2.
    If yes, then like i told use SOURCE with XSLT to create TARGET1 , then use TARGET1 as the input to your next mapping program and create the TARGET2 as the output.
    In your message mapping,
    1 SOURCE   TARGET1  will act as the source and destination message types for one mapping (XSLT>)
    2. TARGET1 TARGET2 will act as the cource and destination mesage types for the other mapping (GRAPHICAL)
    Regards,
    Bhavesh

  • Validation problem in Mapping

    Hi,
    I am getting this error when I am trying to validate the mapping
    Source table is QMI
    " VLD-1002: Mapping object QMI is not bound to a repository object.
    All objects in a mapping must be bound to objects in the Design Repository. Unbound objects inherit the logical location of the module that owns the mapping. Warehouse Builder cannot generate the physical access specification (schema name and database link) for this unbound object. Perform a synchronization from QMI. "
    Could, some body give me a solution for this validation problem.
    Cheers,
    Krishna,

    Hi,
    Thanks for your suggestions. I followed your steps and validating didnt returns any errors.
    But, When I am trying to deploy I am getting a message
    DEPLOYMENT STATUS : USE DEPLOYMENT
    UNDO OR REDO BUTTONS TO CLOSE
    WINDOW TO FINISH, PROCESSED : 0, ERRORS :0, WARNINGS :0.
    I am able to deploy the mappings but not the source tables and target tables. I am getting deploy status failed in the control cetner.
    The work process of my scenario is as follows:
    1) I am having two tables from which I need to populate my target ( NEW table ) with some of the columns from those tables.
    2) I created a two stage tables manually in the database for both of the source tables in two different mappings
    source table 1 into stage table 1 in mapping 1
    source table 2 into stage table 2 in mapping 2
    3) I created a third table as the final target table where I can map these two stage tables into that .
    stage table 1 and stage table 2 into target table in mapping 3 using a JOINER operator. I had given the join condidion as well.
    4) All these stage tables and the final target table and the mappings are in the target module.
    Is this is the way to work on these type of scenarios. Actually I need to JOIN 8 tables and pull some of the necessary columns into the target table based on the condition.
    Intitially I had used a JOINER condition to JOIN those 8 tables in a single mapping.But it gave me the deployment error.
    Could you guys please give me a hand by giving me some suggestion how to proceed in this scenario.
    Last question : Are there any training centers in chennai or Hyderabad where I can get some trining over OWB 10g.
    Cheers,
    Krishna.

  • JAXP API provides no way to enable XML Schema validation mode

    I am evaluating XDK 9.2.0.5.0 for Java and have encountered another
    problem with XML Schema support when using the JAXP API.
    Using the classes in oracle.xml.jaxp.*, it appears to be impossible to
    enable XML Schema validation mode. I can set the schema object, but
    the parser does not use it for validation.
    If I use DOMParser directly, I can call the setValidationMode(int)
    method to turn on schema validation mode. There is no equivalient
    means to enable XML Schema validation when using the JAXP API.
    Test case for JAXP API:
    === begin OracleJAXPSchemaTest.java ======
    package dfranklin;
    import java.io.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import oracle.xml.parser.schema.XMLSchema;
    import oracle.xml.parser.schema.XSDBuilder;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class OracleJAXPSchemaTest
    private final static String xsd = ""
    +"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"urn:dfranklin:test\">"
    +" <xsd:element name=\"amount\" type=\"xsd:integer\"/>"
    +"</xsd:schema>";
    private final static String xml =
    "<amount xmlns=\"urn:dfranklin:test\">1</amount>";
    public static void main(String[] args)
    throws Exception
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
              "oracle.xml.jaxp.JXDocumentBuilderFactory");
    new OracleJAXPSchemaTest().run();
    public void run()
    throws Exception
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setValidating(true);
    dbf.setNamespaceAware(true);
    XMLSchema xmlSchema = buildXMLSchema(new StringReader(xsd));
    dbf.setAttribute("oracle.xml.parser.XMLParser.SchemaObject",
              xmlSchema);
    DocumentBuilder docbldr = dbf.newDocumentBuilder();
    Document doc = docbldr.parse(new InputSource(new StringReader(xml)));
    print(doc);
    private XMLSchema buildXMLSchema(Reader xsdin)
    throws Exception
    XSDBuilder xsdBuilder = new XSDBuilder();
    XMLSchema xmlSchema = (XMLSchema)xsdBuilder.build(xsdin, null);
    return xmlSchema;
    private void print(Document doc)
    throws
    javax.xml.transform.TransformerConfigurationException,
    javax.xml.transform.TransformerException
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.transform(new DOMSource(doc), new StreamResult(System.out));
    System.out.println();
    === end OracleJAXPSchemaTest.java ======
    Running that program:
    java dfranklin.OracleJAXPSchemaTest
    produces this output
    Exception in thread "main" oracle.xml.parser.v2.XMLParseException: Element 'amount' used but not declared.
    at oracle.xml.parser.v2.XMLError.flushErrors(XMLError.java:148)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:269)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
    at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:96)
    at dfranklin.OracleJAXPSchemaTest.run(OracleJAXPSchemaTest.java:40)
    at dfranklin.OracleJAXPSchemaTest.main(OracleJAXPSchemaTest.java:27)
    This shows that the parser is not using the XML Schema to validate the
    document. I think it's expecting to find a DTD.
    Here is the equivalent program using DOMParser directly, and setting
    validation mode to SCHEMA_VALIDATION.
    === begin OracleParserTest.java ====
    package dfranklin;
    import java.io.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import oracle.xml.parser.schema.XMLSchema;
    import oracle.xml.parser.schema.XSDBuilder;
    import oracle.xml.parser.v2.DOMParser;
    import oracle.xml.parser.v2.XMLParser;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class OracleParserTest
    private final static String xsd = ""
    +"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"urn:dfranklin:test\">"
    +" <xsd:element name=\"amount\" type=\"xsd:integer\"/>"
    +"</xsd:schema>";
    private final static String xml =
    "<amount xmlns=\"urn:dfranklin:test\">1</amount>";
    public static void main(String[] args)
    throws Exception
    new OracleParserTest().run();
    public void run()
    throws Exception
    DOMParser dp = new DOMParser();
    XMLSchema xmlSchema = buildXMLSchema(new StringReader(xsd));
    dp.setXMLSchema(xmlSchema);
    dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    dp.parse(new InputSource(new StringReader(xml)));
    Document doc = dp.getDocument();
    print(doc);
    private XMLSchema buildXMLSchema(Reader xsdin)
    throws Exception
    XSDBuilder xsdBuilder = new XSDBuilder();
    XMLSchema xmlSchema = (XMLSchema)xsdBuilder.build(xsdin, null);
    return xmlSchema;
    private void print(Document doc)
    throws
    javax.xml.transform.TransformerConfigurationException,
    javax.xml.transform.TransformerException
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.transform(new DOMSource(doc), new StreamResult(System.out));
    System.out.println();
    === end OracleParserTest.java ====
    Running that program
    java dfranklin.OracleParserTest
    produces this output
    <?xml version = '1.0'?>
    <amount xmlns="urn:dfranklin:test">1</amount>
    In this case, the parser has validated the document.
    I also tried this with version 10.1.0.0.0 beta, and got the same
    error.
    Darin Franklin

    Thanks for posting that. I tried that code and still got my problem. The big difference is that I'm reading a group of XML files each of which uses a large number of schema files. There are over 50 schema files organized so they can be included as needed. Each of the XML files has a noNamespaceSchemaLocation attribute specifying one of the ten top schma files, that includes many others.
    However, I did solve the problem. I added one line --
           saxb.setFeature( "http://apache.org/xml/features/validation/schema",
                    true);
            // next line is new
            saxb.setProperty( JAXPConstants.JAXP_SCHEMA_LANGUAGE,
                    JAXPConstants.W3C_XML_SCHEMA );after the setFeature to turn on schema validation.
    (It needs an import org.apache.xerces.jaxp.JAXPConstants; statement.)
    Note:With the feature set to true and the setProperty commented out, the EntityResolver is called at construction tiem, and for each schema file, but each element is flagged as needing to be declared.
    With the feature commented out, and the setProperty in place, the EntityResolver is not called, and there is no validation performed. (I added invalid content to one of the files and there were no errors listed.)
    With both the setFeature and the setProperty in place, however, I get the calls from the EntityResolver indicating that it is processing the schema files, and for the good files, I get no errror, but for the bad file, I get an error indicating a bad validation.
    Now I can make the EntityResolver quiet and get what I wanted. Maybe there are other ways to do this, but I've got one that works. :-)
    Thanks to all who have helped.
    Dave Patterson

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

    Hi!
    A am parsing XML using JAXP 1.3. If i parse my XML with schema validation, i got an exception: org.xml.sax.SAXParseException: http://www.w3.org/TR/xml-schema-1#cvc-type.3.1.1?g_start&xsi:nil at line: 48 column: 27.
    XML line: 48:
    <g_start xsi:nil="true"></g_start>Schema for this element:
    <xsd:element name="g_start" type="xsd:date" minOccurs="0" nillable="true"/>If i validate my XML with XMLSpy, it's OK.
    Is it problem in my XML, or something wrong with JAXP?

    i wonder what happens if you use
    <g_start xsi:nil="true"/>Nothing changes.
    I make some small sample, if your wold like to test it.
    <?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="root">
      <xsd:complexType>
       <xsd:choice maxOccurs="unbounded">
        <xsd:element name="elem" type="xsd:boolean" minOccurs="0" nillable="true"/>
       </xsd:choice>
      </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    <?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <elem xsi:nil="true"></elem>
    </root>
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = schemaFactory.newSchema(new File("schema.xsd"));
    DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
    documentFactory.setSchema(schema);
    DocumentBuilder documentBuilder = documentFactory.newDocumentBuilder();
    Document document = documentBuilder.parse(new File("data.xml"));

  • Schema validation error at startup

    Configuration:
    WL Portal 9.2
    Linux Fedora Core 6
    I just created a new portal domain and it just does not startup.
    The reported exception is:
    Schema validation errors while parsing /domains/portal/./config/config.xml - Invalid xsi:type qname: 'ext:wsrp-identity-asserterType' in element realm@http://www.bea.com/ns/weblogic/920/domain>
    Schema validation errors while parsing /domains/portal/./config/config.xml - /domains/portal/<unknown>:13:9: error: failed to load java type corresponding to t=wsrp-identity-asserterType@http://www.bea.com/ns/wlp/90/security/wsrp
    I can't find the schema 'http://www.bea.com/ns/wlp/90/security/wsrp.xsd' neither on the web nor the jars supplied with the product.
    Any help would be appreciated.

    Hi, I think you may be missing the binding-file.xml that should be in your mbean jar which should be in your WL_HOME/server/lib/mbeantypes/...
    I am having similar problem and I get this error if I replace the 9.2 MBean jar (generated with MakeMBean) with 8.1 version. The 9.2 MakeMBean utility seems to bundle a bunch of additional jaxb binding files into the jar (xsb, binding-file.xml, *BeanImpl etc). Optionally you can run an 8.1 MBean through the 'weblogic.Upgrade -type securityprovider', this will convert your authentication mbean jar to 9.2 which also includes above mentioned files.
    Once you have an MBean jar, generated with the 9.2 MakeMBean you will probably get a similar error in that the startup will fail with error below: If you know how to fix this please let me know as I have spent a day on this with no luck.
    ...config.xml - C:\...\mydomain\<unknown>:16:9: error: fail
    ed to load java type corresponding to t=ucv-db-authenticatorType@http://www.bea.com/ns/weblogic/90/security/extension>
    <Feb 15, 2007 9:26:29 AM NZDT> <Critical> WebLogicServer> <BEA-000362> <Server failed. Reason: [Management:141245]Schema Validation Error in :\...\server\mydomain\config\config.xml see log for details. Schema validation can be disabled by starting the server with the command line option: -Dweblog
    ic.configuration.schemaValidationEnabled=false>
    PS: setting the -Dweblogic.configuration.schemaValidationEnabled=false option only causes the startup to fail as it cannot load the security provider (if this is your default provider I guess?)
    Hope this helps.

  • XML Schema validation error in network configuration. Missing DnsRef

    When ever we try to make changes to a Virtual network we receive
    XML Schema validation
    error in network configuration. Missing DnsRef
    We can't make any changes to the Virtual network.
    The DNS ref exists as well.
    Considering exporting network config and re-importing however we have a lot of networks configured and want to be sure this is the correct way to proceed.
    Any feedback much appreciated.
    Thanks

    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.

Maybe you are looking for