When validating XML against XSD DateTime not getting recognised

In the XSD the element is defined as
<xs:element name="CreateDate" type="xs:dateTime" nillable="true" minOccurs="0"/>
<xs:element name="CreateUser" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="ModifyDate" type="xs:dateTime" nillable="true" minOccurs="0"/>
in the XML
<CreateDate>1995-04-19 14:37:43</CreateDate>
<CreateUser>JDC</CreateUser>
<ModifyDate>2010-09-21 14:37:43</ModifyDate>
When i validate it
its throwing me error.
ORA-30992 error occured at xpath
ORA-01861 leteral does not match format string.
But when i remove the Time part then it is not throwing error.
<CreateDate>1995-04-19</CreateDate>
<CreateUser>JDC</CreateUser>
<ModifyDate>2010-09-21</ModifyDate>
Help me out.

Your date/time value is formatted incorrectly.
See http://www.w3.org/TR/xmlschema-2/#dateTime
The ·lexical space· of dateTime consists of finite-length sequences of characters of the form: '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?, whereSo you are missing the T between the date and time.
I will agree that the error message is not too helpful. How are you validating it and what version of Oracle (4 digits)?

Similar Messages

  • Validating XML against XSD

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

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

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

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

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

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

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

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

  • When validating, activating my photoshop 13 i get the message internet not active, checked internet is ok, country and time is correct setup

    When validating, activating my photoshop 13 i get the message internet not active, checked internet is ok, country and time is correct setup. What can be checked more to solve this?

    Had this issue myself. I've got no solution for you and customer support has been weak and non-responsive to say the least. Had an online chat with support last Saturday, 12/27, and was assured someone would get back to me via email within 2-3 business days. It's been over a week and no contact. I'm going to start the whole process over again. I personally disabled all firewalls and virus scanners and even went so far as to perform a clean boot on my system with no results. I am having the same problem with a Nero product (different company). It's frustrating as all hell.

  • Error in validating XML against schema

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

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

  • Validate XML against XSD with imported xsd's

    Hello,
    I'm stuck for a while attempting to validate a xml against some xsd's. In the code below you can find my xsd's structure: (I need to use this structure in order to reuse the baseXsd's files.
    CommonTypes.xsd
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema id="CommonTypes" targetNamespace="http://test.com/CommonTypes"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    attributeFormDefault="qualified">
    <xs:simpleType name="NonEmptyString">
    <xs:restriction base="xs:string">
    <xs:minLength value="1"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>
    CommonLog.xsd
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema id="CommonLogConfig"
    targetNamespace="http://test.com/CommonLogConfig"
    xmlns:cmn="http://test.com/CommonTypes"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    attributeFormDefault="qualified">
    <xs:import schemaLocation="..\Base\CommonTypes.xsd" namespace="http://test.com/CommonTypes" />
    <xs:simpleType name="LogName">
    <xs:restriction base="xs:string"/>
    </xs:simpleType>
    <xs:simpleType name="LogPath">
    <xs:restriction base="cmn:NonEmptyString"/>
    </xs:simpleType>
    </xs:schema>
    LogConfig.xsd
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:mlc="http://test.com/CommonLogConfig"
    targetNamespace="component1_LogConfig"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    attributeFormDefault="qualified">
    <xs:import schemaLocation="..\Base\CommonLogConfig.xsd" namespace="http://test.com/CommonLogConfig" />
    <xs:element name="root">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="default">
    <xs:complexType>
    <xs:all>
    <xs:element name="LogName" type="mlc:LogName" fixed="component.name" />
    <xs:element name="LogPath" type="mlc:LogPath"/>
    </xs:all>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    LogConfig.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root xmlns="component1_LogConfig">
    <default>
    <LogName>component.name</LogName>
    <LogPath></LogPath>
    </default>
    </root>
    As you can probably notice, the <LogPath> key on the LogConfig is empty, but, it is defined as a NonEmptyString type. That is the way I'm validating the xml against xsd:
    FileStream stream = new FileStream("LogConfig.xml", FileMode.Open);
    XmlValidatingReader vr = new XmlValidatingReader(stream, XmlNodeType.Element, null);
    vr.Schemas.Add(null, "LogConfig.xsd");
    vr.ValidationType = ValidationType.Schema;
    vr.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
    while (vr.Read()) ;
    The validationCallBack is not being fired.
    I suppose it is possible since the visual studio show me the error at compile time:

    Well, it is weird, but, the code below works when validating the NonEmptyString type:
    XmlSchemaSet schemaSet = new XmlSchemaSet();
    schemaSet.Add(null, "LogConfig.xsd");
    XDocument doc1 = XDocument.Load("LogConfig.xml");
    doc1.Validate(schemaSet, new ValidationEventHandler(ValidationCallBack), false);
    However, if I leave the <LogName> empty it does not valid the values set on xsd fixed attribute, 
    The solution?
    Well, I'm validating the same xml twice, the code above and the code on my first question.

  • Valodate xml against xsd

    Hi ,
    I have the below as "position.xml"
    <?xml version="1.0" encoding="UTF-8"?>
    <position
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="file://c:\wsad\workspace\sma\xml\position.xsd">
    <position_number>12345</position_number>
    <position_title>Sr. Engr</position_title>
    <report_to_position>23456</report_to_position>
    <incumbent>23456</incumbent>
    <operation>INSERT</operation>
    </position>
    and
    position.xsd is :
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Root">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="position" type="positionType" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
         <xs:complexType name="positionType">
    <xs:sequence>
         <xs:element name="position_number" type="xs:string"/>
    <xs:element name="position_title" type="xs:string"/>
         <xs:element name="report_to_position" type="xs:string"/>
         <xs:element name="incumbent"           type="xs:string"/>
         <xs:element name="operation"           type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    When i use the code:
    import org.apache.xerces.parsers.DOMParser;
    import java.io.File;
    public class SchemaTest {
         private String xmlFile = "";
         private String xsdFile = "";
         public SchemaTest(String xmlFile, String xsdFile) {
              this.xmlFile = xmlFile;
              this.xsdFile = xsdFile;
         public static void main(String args[]) {
              for (int i = 0; i < args.length; i++) {
                   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;
              if (args.length != 2) {
                   System.err.println("Usage: <xml file> <xsd file>");
                   System.exit(1);
              SchemaTest testXml = new SchemaTest(args[0], args[1]);
              testXml.process();
         public void process() {
              File docFile = new File(xmlFile);
              try {
                   DOMParser parser = new DOMParser();
                   parser.setFeature("http://xml.org/sax/features/validation", true);
                   parser.setFeature("http://apache.org/xml/features/validation/schema",true);
                   parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    //               parser.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation", xsdFile);
                   parser.setProperty(
                        "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                        xsdFile);
                   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);
    I get the following error message:
    XML File=[Ljava.lang.String;@45a877
    XSD File=[Ljava.lang.String;@45a877
    Line 4...
    cvc-elt.1: Cannot find the declaration of element 'position'.
    Line 4...
    cvc-datatype-valid.1.2.1: 'file://c:\wsad\workspace\sma\xml\position.xsd' is not a valid value for 'anyURI'.
    Line 4...
    cvc-attribute.3: The value 'file://c:\wsad\workspace\sma\xml\position.xsd' of attribute 'xsi:noNamespaceSchemaLocation' on element 'position' is not valid with respect to its type, 'anyURI'.
    Can someone help !!!!!!!!
    Thanks !

    cvc-datatype-valid.1.2.1: 'file://c:\wsad\workspace\sma\xml\position.xsd' is not a valid value for 'anyURI'.I am guessing that's in a place that is supposed to have a URI. Well, if you're going to have backslashes in a URI then you have to escape them as %5C. But if you meant for them to separate directory names, then replace them by slashes as per the URI specification.

  • How to parse XML against XSD,DTD, etc.. locally (no internet connection) ?

    i've searched on how to parse xml against xsd,dtd,etc.. without the needs of internet connection..
    but unfortunately, only the xsd file can be set locally and still there needs the internet connection for the other features, properties.
    XML: GML file input from gui
    XSD: input from gui
    javax.xml
    package demo;
    import java.io.File;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.xml.XMLConstants;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    import org.xml.sax.SAXException;
    public class Sample1WithJavaxXML {
         public static void main(String[] args) {
              URL schemaFile = null;
              try {
                   //schemaFile = new URL("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd");
                   File file0 = new File("AppSchema-C01-v1_0.xsd");
                   schemaFile = new URL(file0.toURI().toString());
              } catch (MalformedURLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              //Source xmlFile = new StreamSource(new File("web.xml"));
              Source xmlFile = new StreamSource(new File("C01.xml"));
              SchemaFactory schemaFactory = SchemaFactory
                  .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              //File file1 = new File("XMLSchema.dtd");
              //SchemaFactory schemaFactory = SchemaFactory
                   //.newInstance("javax.xml.validation.SchemaFactory:XMLSchema.dtd");
              Schema schema = null;
              try {
                   schema = schemaFactory.newSchema(schemaFile);
              } catch (SAXException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              Validator validator = schema.newValidator();
              try {
                validator.validate(xmlFile);
                System.out.println(xmlFile.getSystemId() + " is valid");
              } catch (SAXException e) {
                System.out.println(xmlFile.getSystemId() + " is NOT valid");
                System.out.println("Reason: " + e.getLocalizedMessage());
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Xerces
    package demo;
    import java.io.File;
    import java.util.Date;
    import org.apache.xerces.parsers.DOMParser;
    public class SchemaTest {
         private String xmlFile = "";
         private String xsdFile = "";
         public SchemaTest(String xmlFile, String xsdFile) {
              this.xmlFile = xmlFile;
              this.xsdFile = xsdFile;
         public static void main (String args[]) {
              File file0 = new File("AppSchema-C01-v1_0.xsd");
              String xsd = file0.toURI().toString();
              SchemaTest testXml = new SchemaTest("C01.xml",xsd);
              testXml.process();
         public void process() {
              File docFile = new File(xmlFile);
              DOMParser parser = new DOMParser();
              try {
                   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);
                   ErrorChecker errors = new ErrorChecker();
                   parser.setErrorHandler(errors);
                   System.out.println(new Date().toString() + " START");
                   parser.parse(docFile.toString());
              } catch (Exception e) {
                   System.out.print("Problem parsing the file.");
                   System.out.println("Error: " + e);
                   System.out.println(new Date().toString() + " ERROR");
                   return;
              System.out.println(new Date().toString() + " END");
    }

    Thanks a lot Sir DrClap..
    I tried to use and implement the org.w3c.dom.ls.LSResourceResolver Interface which is based on the SAX2 EntityResolver.
    please give comments the way I implement it. Here's the code:
    LSResourceResolver Implementation
    import org.w3c.dom.ls.LSInput;
    import org.w3c.dom.ls.LSResourceResolver;
    import abc.xml.XsdConstant.Path.DTD;
    import abc.xml.XsdConstant.Path.XSD;
    public class LSResourceResolverImpl implements LSResourceResolver {
         public LSResourceResolverImpl() {
          * {@inheritDoc}
         @Override
         public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
              ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
              LSInput input = new LSInputImpl(publicId, systemId, baseURI);
              if ("http://www.w3.org/2001/xml.xsd".equals(systemId)) {
                   input.setByteStream(classLoader.getResourceAsStream(XSD.XML));
              } else if (XsdConstant.PUBLIC_ID_XMLSCHEMA.equals(publicId)) {
                   input.setByteStream(classLoader.getResourceAsStream(DTD.XML_SCHEMA));
              } else if (XsdConstant.PUBLIC_ID_DATATYPES.equals(publicId)) {
                   input.setByteStream(classLoader.getResourceAsStream(DTD.DATATYPES));
              return input;
    }I also implement org.w3c.dom.ls.LSInput
    import java.io.InputStream;
    import java.io.Reader;
    import org.w3c.dom.ls.LSInput;
    public class LSInputImpl implements LSInput {
         private String publicId;
         private String systemId;
         private String baseURI;
         private InputStream byteStream;
         private String stringData;
         public LSInputImpl(String publicId, String systemId, String baseURI) {
              super();
              this.publicId = publicId;
              this.systemId = systemId;
              this.baseURI = baseURI;
         //getters & setters
    }Then, here's the usage/application:
    I create XMLChecker class (SchemaFactory implementation is Xerces)
    import java.io.File;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.XMLConstants;
    import javax.xml.stream.FactoryConfigurationError;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import abc.xml.XsdConstant.Path.XSD;
    public class XMLChecker {
         private ErrorMessage errorMessage = new ErrorMessage();
         public boolean validate(String filePath){
              final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
              List<Source> schemas = new ArrayList<Source>();
              schemas.add(new StreamSource(classLoader.getResourceAsStream(XSD.XML_SCHEMA)));
              schemas.add(new StreamSource(classLoader.getResourceAsStream(XSD.XLINKS)));
              schemas.add(new StreamSource(classLoader.getResourceAsStream("abc/xml/AppSchema.xsd")));
              SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              schemaFactory.setResourceResolver(new LSResourceResolverImpl());
              try {
                   Schema schema = schemaFactory.newSchema(schemas.toArray(new Source[schemas.size()]));
                   Validator validator = schema.newValidator();
                   validator.setErrorHandler(new ErrorHandler() {
                        @Override
                        public void error(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                        @Override
                        public void fatalError(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                        @Override
                        public void warning(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                   StreamSource source = new StreamSource(new File(filePath));
                   validator.validate(source);
              } catch (SAXParseException e) {
                   return false;
              } catch (SAXException e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              } catch (FactoryConfigurationError e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              } catch (IOException e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              return true;
         public ErrorMessage getErrorMessage() {
              return errorMessage;
    }Edited by: erossy on Aug 31, 2010 1:56 AM

  • How to validate XML against XSD and parse/save in one step using SAXParser?

    How to validate XML against XSD and parse/save in one step using SAXParser?
    I currently have an XML file and XSD. The XML file specifies the location of the XSD. In Java code I create a SAXParser with parameters indicating that it needs to validate the XML. However, SAXParser.parse does not validate the XML, but it does call my handler functions which save the elements/attributes in memory as it is read. On the other hand, XMLReader.parse does validate the XML against the XSD, but does not save the document in memory.
    My code can call XMLReader.parse to validate the XML followed by SAXParser.parse to save the XML document in memory. But this sound inefficient. Besides, while a valid document is being parsed by XMLReader, it can be changed to be invalid and saved, and XMLReader.parse would be looking at the original file and would think that the file is OK, and then SAXParser.parse would parse the document without errors.
    <Book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="book.xsd" name="MyBook">
      <Chapter name="First Chapter"/>
      <Chapter name="Second Chapter">
        <Section number="1"/>
        <Section number="2"/>
      </Chapter>
    </Book>
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Book">
    <xs:complexType>
      <xs:sequence>
       <xs:element name="Chapter" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="Section" minOccurs="0" maxOccurs="unbounded">
           <xs:complexType>
            <xs:attribute name="xnumber"/>
          </xs:complexType>
          </xs:element>
         </xs:sequence>
         <xs:attribute name="name"/>
        </xs:complexType>
       </xs:element>
      </xs:sequence>
      <xs:attribute name="name"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    public class SAXXMLParserTest
       public static void main(String[] args)
          try
             SAXParserFactory factory = SAXParserFactory.newInstance();
             factory.setNamespaceAware(true);
             factory.setValidating(true);
             SAXParser parser = factory.newSAXParser();
             parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
                                "http://www.w3.org/2001/XMLSchema");
             BookHandler handler = new BookHandler();
             XMLReader reader = parser.getXMLReader();
             reader.setErrorHandler(handler);
             parser.parse("xmltest.dat", handler); // does not throw validation error
             Book book = handler.getBook();
             System.out.println(book);
             reader.parse("xmltest.dat"); // throws validation error because of 'xnumber' in the XSD
    public class Book extends Element
       private String name;
       private List<Chapter> chapters = new ArrayList<Chapter>();
       public Book(String name)
          this.name = name;
       public void addChapter(Chapter chapter)
          chapters.add(chapter);
       public String toString()
          StringBuilder builder = new StringBuilder();
          builder.append("<Book name=\"").append(name).append("\">\n");
          for (Chapter chapter: chapters)
             builder.append(chapter.toString());
          builder.append("</Book>\n");
          return builder.toString();
       public static class BookHandler extends DefaultHandler
          private Stack<Element> root = null;
          private Book book = null;
          public void startDocument()
             root = new Stack<Element>();
          public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
             if (qName.equals("Book"))
                String name = attributes.getValue("name");
                root.push(new Book(name));
             else if (qName.equals("Chapter"))
                String name = attributes.getValue("name");
                Chapter child = new Chapter(name);
                ((Book)root.peek()).addChapter(child);
                root.push(child);
             else if (qName.equals("Section"))
                Integer number = Integer.parseInt(attributes.getValue("number"));
                Section child = new Section(number);
                ((Chapter)root.peek()).addSection(child);
                root.push(child);
          public void endElement(String uri, String localName, String qName) throws SAXException
             Element finished = root.pop();
             if (root.size() == 0)
                book = (Book) finished;
          public Book getBook()
             return book;
          public void error(SAXParseException e)
             System.out.println(e.getMessage());
          public void fatalError(SAXParseException e)
             error(e);
          public void warning(SAXParseException e)
             error(e);
    public class Chapter extends Element
       public static class Section extends Element
          private Integer number;
          public Section(Integer number)
             this.number = number;
          public String toString()
             StringBuilder builder = new StringBuilder();
             builder.append("<Section number=\"").append(number).append("\"/>\n");
             return builder.toString();
       private String name;
       private List<Section> sections = null;
       public Chapter(String name)
          this.name = name;
       public void addSection(Section section)
          if (sections == null)
             sections = new ArrayList<Section>();
          sections.add(section);
       public String toString()
          StringBuilder builder = new StringBuilder();
          builder.append("<Chapter name=\"").append(name).append("\">\n");
          if (sections != null)
             for (Section section: sections)
                builder.append(section.toString());
          builder.append("</Chapter>\n");
          return builder.toString();
    }Edited by: sn72 on Oct 28, 2008 1:16 PM

    Have you looked at the XML DB FAQ thread (second post) in this forum? It has some examples for validating XML against schemas.

  • How to Validate XML against XSD through PL/SQL?

    Hi friends,
    I m new to this forum. This is my first query.
    In our project, we are trying to generate output XML using PL/SQL procedure. I have done that successfully. Now my problem is I have to validate this against our XSD. How will I do that? Can you provide me with a sample example.
    Thanks to all in advance.
    Regards,
    apk

    Have you looked at the XML DB FAQ thread (second post) in this forum? It has some examples for validating XML against schemas.

  • When PO is cancelled PR is not getting updated.

    Hi all,
    I have written a condition for pending pr.
    COMPUTE pending pr qty = EBAN-MENGE - EBAN-BSMNG .
    But in case if the po is cancelled the quantitiy is not getting reverted.
    When PO is cancelled PR is not getting updated.
    Is there any other condition to  check or any solution please.
    Regards,
    Priya

    Hello Sivapriyaramesh,
    Link: [http://www.finance.utoronto.ca/fast/qrg/purch/po/finalizecancel.htm]
    Please check the link. hope this solves your problem.
    Cheers,
    Suvendu

  • I Just received the update to iTunes, when I I look at the screen I do not see the normal icons.  When I select movies I do not get the new downloads unless i select the list in the sub file. How do I get backto the old method of seeing and using iTunes??

    I Just received the update to iTunes, when I I look at the screen I do not see the normal icons.  When I select movies I do not get the new downloads unless I select the list in the sub file. How do I get back to the old method of seeing and using iTunes??

    I can tell you that this is some of the absolutely worst customer service I have ever dealt with. I found out from a store employee that when they are really busy with calls, they have third party companies taking overflow calls. One of those companies is Xerox. What can a Xerox call center rep possibly be able to authorize on a Verizon account?  I'm Sure there is a ton of misinformation out there due to this. They don't note the accounts properly or so everyone can see them. I have been transferred before and have asked if they work for Verizon or a third party also and was refused an answer so, apparently they aren't required to disclose that information. I spent a long time in the store on my last visit and it's not just customers that get the runaround. It happens to the store employees as well and it's beyond frustrating.

  • I downloaded Magzter app button iPad 2 but when I buy magazines it is not getting downloaded but the same is getting downloaded in my iPod. Pl help. Magzter support is unable to help.

    I downloaded Magzter app button iPad 2 but when I buy magazines it is not getting downloaded but the same is getting downloaded in my iPod. Pl help. Magzter support is unable to help.

    You will not be able to see what version you are running until the iPad is activated. It will be in Settings>General>About >Version when you can get to the settings app.
    The slider bar that you are describing sounds like the screen lock side switch and that has no bearing on setting up the iPad or connecting to WiFi.
    Why don't you try rebooting your router? Unplug it for about 30 seconds and then plug it in again and see if the iPad will recognize and join the network.

  • Does XDB supports validating xml against multiple schemas?

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

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

Maybe you are looking for