Inbound XML validation failed against schema

Hi Experts,
we are getting mapping exception at the time of Inbound XML validation but in the trace it is not displaying
like which fields are not validating.
I have gone through the Interface mapping in that we are using 2 mapping programs one is imported archives(java mapping) for validation
and another one is for Messaging mapping.we are getting the problem at the time of validation itself,
i have navigated by double clicking on the imported archive mapping program it is taken into another page
where we will get the archive programs.we have soo many xsd files and its path, and one .java file and class file
for validatting the xsd files. up to now everything is fine.
please find the remaining question in the below post

CONTINUATION QUESTION FOR THE ABOVE
If i click on the xsd files it is displaying the complete schema structure, but in the case of 2 xsd files(those are using in one
interface where we are getting validation error)it is displaying the error like "cannot display file com/AAA/BBB/java/CCC/xi/bc/validator/xsds/<filename.xsd> unable to determine code".as per my assumption the xsd file
is not present in that perticular path, if so how can i put these xsd files into the path specified? how can i get that folders to nagvigate into that path? And also i am not able to download the xsd file from the external defination, is it work if i copy the file into note pad and by changing the extension as .xsd ?
We are using PI7.0, give me an idea how to resolve the issue
Thanks in Advance

Similar Messages

  • JAXP, XML without SchemaLocation against Schema

    I have problems with JAXP
    I have been checking samples JAXP in next URL:
    http://xml.apache.org/~edwingo/jaxp-ri-1.2.0-fcs/docs/samples.html
    I have
    - request.xml (on bottom)
    - http://www.oasis-open.org/committees/security/docs/cs-sstc-schema-protocol-01.xsd
    My XML validation don't use xsi:hints in instance document
    my cmd> java DOMEcho -xsdss http://www.oasis-open.org/committees/security/docs/cs-sstc-schema-protocol-01.xsd request.xml
    ERROR:
    java.lang.StackOverflowError
         at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:575)
         at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
         at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
         at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
         at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
    Can anybody send me one document xml without xsi:hints and its XML Schema for check this examples???
    request.xml
    <samlp:Request IssueInstant="2002-07-09T13:56:41Z" MajorVersion="1" MinorVersion="0" RequestID="62.36.95.97.1026223001110" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol">
    <samlp:AssertionArtifact>AAEQg2E01sLUvoGL7jo0gkrf3lw3lQAAAAAAAAAAAAAAANUDN5LCBWe5</samlp:AssertionArtifact>
    </samlp:Request>

    Has anyone solved this problem?
    I'm facing exact same one!
    Please, help!
    Vadim.

  • Validation fails when schema and xml doc are located in different folders

    xml file and schema are in different folder. Schema uses namespaces. When I try to validate, I get exception:
    truecvc-elt.1: Cannot find the declaration of element 'Start'
    In xml document I have a Start element, which is a root element like this:
    <Start ... xsi:schemaLocation https://test.fi/Start
    C:/my_schema_folder/2005/Start.xsd>...</Start>
    xml document is in C:/my_xml_folder/test.xml
    Why this dont work? I try to validate laki this:
    SAXParser parser = new SAXParser();
    try
              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", SchemaUrl );
              Validator handler=new Validator();
              parser.setErrorHandler(handler);
              parser.parse(XmlDocumentUrl);
              if(handler.validationError==true)
              System.out.println("XML Document has Error:"+handler.validationError+""+handler.saxParseException.getMessage());
              else
              System.out.println("XML Document is valid");
         catch(java.io.IOException ioe)
              System.out.println("IOException"+ioe.getMessage());
         }catch (SAXException e)
              System.out.println("SAXException"+e.getMessage());
         }

    Sorry, my bad. It was just a typing error...aaaargh!!! ;)

  • XML validation fails

    Hello,
    We are trying to validate an XML against a DTD using XDK 9.2.0.5.0 and it fails. The same XML was validated without any problem earlier, but, suddenly started failing with the following error.
    XML-0201: (Fatal Error) Expected name instead of .
    If I open the above XML in XMLSPY or any other XML parsing tools, the tool is showing as valid xml file.
    Interestingly, if I add a whitespace after encoding statement,but, before ? (<?xml version="1.0" encoding="us-ascii" ?>), the XML is valid with the XDK.
    If I remove the whitespace (<?xml version="1.0" encoding="us-ascii"?>), the XML is invalid with XDK.
    What could have been a problem ?
    Thanks for your time.
    Satya

    Does the error get generated with encoding utf-8.

  • XML Validation failing

    Hi,
    I have XSD file, My application generates xml file dynamically.
    When validating my xml with the XSD i am getting below exception messages.please find the code of XSD amd XML files.
    org.xml.sax.SAXParseException: cvc-pattern-valid: Value '300' is not facet-valid with respect to pattern '[0-2][0-9][0-5][0-9]' for type 'TimeValidation'.
    org.xml.sax.SAXParseException: cvc-type.3.1.3: The value '300' of element 'StartTime' is not valid.
    org.xml.sax.SAXParseException: cvc-complex-type.2.4.d: Invalid content was found starting with element 'AutoReplyText'. No child element is expected at this point.
    XSD_Code_
    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <xsd:schema><xsd:element name="AutoReplyReq"><xsd:complexType><xsd:sequence><xsd:element name="TransactionID" type="TransIDValidation"/><xsd:element name="MSISDN" type="MSISDNTYPE"/><xsd:element name="Action" type="Action"/><xsd:element name="AutoReplyElements" type="AutoReplyElements" minOccurs="0" maxOccurs="10"/></xsd:sequence></xsd:complexType></xsd:element><xsd:complexType name="AutoReplyElements"><xsd:sequence><xsd:element name="AutoReplyId" type="IdValidation" minOccurs="1"/><xsd:element name="KeyWordList" type="xsd:string" minOccurs="0"/><xsd:element name="AutoReplyText" type="TextValidation" minOccurs="0"/><xsd:element name="OARuleName" type="NameValidation" minOccurs="0"/><xsd:element name="OARuleType" type="OARuleType" minOccurs="0"/><xsd:element name="OAList" type="OAListValidation" minOccurs="0"/><xsd:element name="TBSRuleName" type="NameValidation" minOccurs="0"/><xsd:element name="TBSRuleType" type="OARuleType" minOccurs="0"/><xsd:element name="StartDay" type="DayValidation" minOccurs="0"/><xsd:element name="EndDay" type="DayValidation" minOccurs="0"/><xsd:element name="StartTime" type="TimeValidation" minOccurs="0"/><xsd:element name="EndTime" type="TimeValidation" minOccurs="0"/></xsd:sequence></xsd:complexType><xsd:simpleType name="TransIDValidation"><xsd:restriction base="xsd:int"><xsd:minInclusive value="1"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="NameValidation"><xsd:restriction base="xsd:string"><xsd:minLength value="1"/><xsd:maxLength value="20"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="TextValidation"><xsd:restriction base="xsd:string"><xsd:minLength value="1"/><xsd:maxLength value="160"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="MSISDNTYPE"><xsd:restriction base="xsd:long"><xsd:pattern value="\d{10,21}"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="OAListValidation"><xsd:restriction base="xsd:string"><xsd:pattern value="([0-9,]+)"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="TimeValidation"><xsd:restriction base="xsd:int"><xsd:pattern value="[0-2][0-9][0-5][0-9]"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="Action"><xsd:restriction base="xsd:string"><xsd:enumeration value="Subscribe"/><xsd:enumeration value="Activate"/><xsd:enumeration value="Update"/><xsd:enumeration value="Delete"/><xsd:enumeration value="Deactivate"/><xsd:enumeration value="Unsubscribe"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="OARuleType"><xsd:restriction base="xsd:string"><xsd:enumeration value="All"/><xsd:enumeration value="Specific"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="IdValidation"><xsd:restriction base="xsd:int"><xsd:minInclusive value="0"/><xsd:maxInclusive value="20"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="DayValidation"><xsd:restriction base="xsd:int"><xsd:minInclusive value="1"/><xsd:maxInclusive value="7"/></xsd:restriction></xsd:simpleType></xsd:schema>
    XML code
    <?xml version="1.0"?>
    <AutoReplyReq>
    <TransactionID>5</TransactionID>
    <MSISDN>919988776655</MSISDN>
    <Action>Activate</Action>
    <AutoReplyElements>
    <AutoReplyId>4</AutoReplyId>
    <KeyWordList>hhhhhhhhhhhhhhhhhhhhhhhkkkkkk</KeyWordList>
    <OARuleName>ppppppppp</OARuleName><OARuleType>Specific</OARuleType><OAList>7458963251</OAList><TBSRuleName>ddfdfdf</TBSRuleName><TBSRuleType>Specific</TBSRuleType><StartDay>1</StartDay><EndDay>5</EndDay><StartTime>0</StartTime><EndTime>1300</EndTime><AutoReplyText>rrrrrrrrrrrrrrrrrrrrrr</AutoReplyText></AutoReplyElements></AutoReplyReq>
    Please do needful in fixing this issue.

    The value '300' of element 'StartTime' is not validAccording to that you have <StartTime>300</StartTime>
    <StartTime>0</StartTime>According to that you have zero. However the exception doesn't agree with you.
    Please do needful in fixing this issue.It is you that wil fix this issue. All you will get here is advice and guidance.

  • [CC] Search for Workaround for old Bug: XML Validation fails

    In Dreamweaver the validation of an XHTML document "as XML" fails.
    Result:
    An exception occurred! Type:NetAccessorException, Message:Could not open file: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd[xml]
    The bug seems to be very old:
    http://forums.adobe.com/thread/874435
    Do you know any workaround? Is there may be a plugin which can validate XML?
    Thanks.

    I appreciate your detailed answers, David. It's a pleasure to discuss with you
    My own criterium, if a non-fixing is shameful or not, does not depend on the frequency of the usage of a function (by me or any other user).
    It depends on the facts, that Adobe knows the bug since many years and that it is a bug in a very basic module - the search and replace module.
    I take it as a proof of my assumption, that Adobe behaves arrogantly in many ways.
    They just don't care about maintanance.
    Thanks for filing the bug about "validate as xml".
    I logged into my prerelease account (I took part some years ago). But it seems that I have no access to the bug database.
    In my prerelease account there's no link to the bug database.
    I agree with you, that concerns would have more chances to be read by developers when you talk about them in the pre release forums.
    But my experiences with filing bugs are so disappointing, that I do not like to spend my time anymore for that.
    While betatesting we had a "personal usability engineer" to talk to him. I talked a lot to him, constructively and polite. But in fact, he has no influence to the decisions which bugs will fixed and which not.
    We can talk about the search and replace module in 10 years.
    I'm sure it will look the same as today. It will have the same bugs as today. It will have the same functionality as today.
    No improvement at all in such an important module.
    That's my assumption based on the experience of the last 8 years.

  • XML validation using javax.xml.validation

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

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

  • Validating with multiple schemas

    I am setting the schama attribute as follow:
    String schemaSource = "C:\\Documents and Settings\\ayache\\My Documents\\C5 XML\\schema\\searhRequest.xsd";
                   String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
                   builderFactory.setAttribute(JAXP_SCHEMA_SOURCE, new File(schemaSource));searchRequest.xsd contains include statement: it referes to another schema. When i try to validate the xml document using the scheam above error is thrown stating that the elements that are defined in the second schema(BookingProfile.xsd) are not recognised or can't be resolved.
    Is there a way to set multiple schemas?
    Your help is much appreciated.

    I figured out my problem in case anyone else is having trouble..
    In the xml document that you need to refer to:
    xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance that is the namespace
    supported by xerces 1.3.1.
    Whew!
    "Karen Schaper" <[email protected]> wrote:
    >
    Has anyone been successful at validating xml with a Schema running weblogic
    6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema",
    "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)),
    A_HANDLER);
    When my xml code runs through the parser I get an error for each element
    saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml
    validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

  • QUESTION: XML validation against a schema - for beginners

    Hi folks,
    i am new to XML validation.
    i would like to find out how to validate an XML file using a schema given to me by a third part company.
    the business process requires that our company sends a weekly file which complies with their schema.
    in real-life, i am expecting some details of our file to fail against their schema.
    thus i would like to find a way validating the file localy before sending it to this third part.
    this validation would ideally allow me to highlight and identify which records are failing the validation, and enable me to strip those and send only those that are successfully checked.
    on the example below, i would expect to have the record for John Smith to be successful (country has an integer); while Queen Victoria would fail as it uses UK instead of an integer to identify the country.
    thus i would need to find a way validating this XML file, move the record of Queen Victoria to another file to be fixed and to allow, the record for John Smith to be sent out.
    if you guys could post some links to where i can find further information on this type of processing, i would be most grateful.
    Many thanks,
    Nicolas
    using an example from:
    [http://www.codeguru.com/csharp/csharp/cs_data/xml/article.php/c6737]
    XSD
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="address">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="name" type="xs:string"/>
    <xs:element name="street" type="xs:string"/>
    <xs:element name="city"type="xs:string"/>
    *<xs:element name="country"type="xs:integer"/>*
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>XML
    <address>
    <name>John Smith</name>
    <street>109 Abbey Close</street>
    <city>Hayes</city>
    <country>98</country>
    </address>
    <address>
    <name>Queen Victoria</name>
    <street>1 Regent Street</street>
    <city>London</city>
    <country>UK</country>
    </address>Edited by: www.jegue.net on Jan 13, 2009 9:48 AM
    Edited by: www.jegue.net on Jan 13, 2009 9:49 AM

    i would need to find a way validating this XML file, move the record of Queen Victoria to another file to be fixed and to allow, the record for John Smith to be sent out.I don't think any automated tool or API available with such features. You should achieve this by some tricky logic/code.

  • XML validation against schema in XSD format

    I have a requirement for validation of XML file against XML schema(XSD format). Using IXML liabrary I know how to validate XML file against schema in DTD format. But i am not getting how to do it against XSD. Is it possible using IXML liabrary? Also i wanted to know how to attach one XML or CSV file into another XML file using SAP ABAP.
    Please provide solution!!

    Hi Madhura,
    see here my comparison of the web version against the local file version on my Windows box (which is itself not the fastest): It makes a factor 16 in difference!
    C:\Temp\xsdvalidator>java XsdValidator madhu.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 16353 ms
    C:\Temp\xsdvalidator>java XsdValidator madhu_local.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 994 ms
    Obviously, the w3c.org domain that you specified as ressource location is very slow - and, as the FAQ shows, this delay is intentional!
    The W3C servers are slow to return DTDs. Is the delay intentional?
    Yes. Due to various software systems downloading DTDs from our site millions of times a day (despite the caching directives of our servers), we have started to serve DTDs and schema (DTD, XSD, ENT, MOD, etc.) from our site with an artificial delay. Our goals in doing so are to bring more attention to our ongoing issues with excessive DTD traffic, and to protect the stability and response time of the rest of our site. We recommend HTTP caching or catalog files to improve performance.
    --> They don't want to have requests to their site from productive servers all around the world.
    Regards,
    Rüdiger

  • 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

  • In-memonry xml document validation against schema with xerces

    Hello, there.
    I found that I can't use JAXP's javax.xml.validation package with jdk 1.4. (Am I wrong?)
    Anyway,
    I found that I can use xerces's DOMParser for the same purpose.
    But I can't find the way to validate my programmatically generate org.w3c.dom.Document against existing schema file.
    Can anybody help me?
    Thanks.

    Have you read Xerces documentation or SUN xml API, there is always a parser option (I suppose it's in the standard) to validate input while parsing.
    Look the API : http://java.sun.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#setValidating(boolean)

  • Question about validating xml against schema

    Hi,
    I am new to JAXP. I try to validating a xml against a schema. I wrote following code:
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespace(true);
    spf.setValidating(true);
    SAXParser sp = spf.newSAXParser();
    sp.setProperty("http://java.sun.com/xml/properties/jaxp/schemaLanguage",
    "http://www.w3.org/2001/XMLSchema");
    sp.setProperty("http://java.sun.com/xml/properties/jaxp/schemaSource",
    "mySchema.xsd") ;
    sp.parse(<XML Document>, <ContentHandler);
    but when compile, it has error: can't resolve ""http://java.sun.com/xml/properties/jaxp/schemaLanguage", and
    "http://java.sun.com/xml/properties/jaxp/schemaSource".
    It seems it didn't support above two property.
    I saw some code in forum is:
    fact.setFeature("http://xml.org/sax/features/validation", true);
    fact.setFeature("http://apache.org/xml/features/validation/schema",true);
    fact.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    SAXParser sp = fact.newSAXParser();
    sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemas);
    Why sun tutorial use property:http://java.sun.com/xml/properties/jaxp/schemaLanguage
    and someone use:http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation
    where to get information about setting properties for SAXParserFactory?
    Thanks

    In the past, ColdFusion's XML validation mechanism seems to have had issues with schemas that contain imports, e.g., http://forums.adobe.com/message/155906. Have these issues still not been resolved?
    Do you not think that perhaps you're answering your own question here?
    I don't see an issue about this on the bug tracker.  It might be an idea if you can get a simple, stand-alone repro case together and raise an issue (and post the reference back here and against that other thread so people know to vote for it).  If you post the repro case here too, it would be helpful.
    Adam

  • Question about XML validation against schema

    My question is probably a basic one about XML. I tried PurchaseOrder example from the book "J2EE Web Services" by Richard Monson-Haefel. A simplified version as followings -
    Address.xsd -
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xml.netbeans.org/schema/Address"
    xmlns:addr="http://xml.netbeans.org/schema/Address"
    elementFormDefault="qualified">
    <element name="address" type="addr:USAddress" />
    <complexType name="USAddress">
    <sequence>
    <element name="name" type="string" />
    <element name="street" type="string" />
    <element name="city" type="string" />
    <element name="state" type="string" />
    <element name="zip" type="string" />
    </sequence>
    </complexType>
    </schema>
    PurchaseOrder.xsd -
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xml.netbeans.org/schema/PurchaseOrder"
    xmlns:po="http://xml.netbeans.org/schema/PurchaseOrder"
    xmlns:ad="http://xml.netbeans.org/schema/Address"
    elementFormDefault="qualified">
    <import namespace="http://xml.netbeans.org/schema/Address" schemaLocation="Address.xsd" />
    <element name="purchaseOrder" type="po:PurchaseOrder" />
    <complexType name="PurchaseOrder">
    <sequence>
    <element name="accountName" type="string" />
    <element name="accountNumber" type="unsignedShort" />
    <element name="shipAddress" type="ad:USAddress" />
    <element name="total" type="float" />
    </sequence>
    <attribute name="orderDate" type="date" />
    </complexType>
    </schema>
    Then PurchaseOrder.xml is -
    <purchaseOrder orderDate="2007-12-12"
    xmlns='http://xml.netbeans.org/schema/PurchaseOrder'
    xmlns:addr="http://xml.netbeans.org/schema/Address"
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xsi:schemaLocation='http://xml.netbeans.org/schema/PurchaseOrder ../xsd/PurchaseOrder.xsd'>
    <accountName>Starwood</accountName>
    <accountNumber>220</accountNumber>
    <shipAddress>
    <name>Data Center</name>
    <street>1501 Washington St.</street>
    <city>Braintree</city>
    <state>MA</state>
    <zip>02148</zip>
    </shipAddress>
    <total>250</total>
    </purchaseOrder>
    Then I did a XML validation but have this error -
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'name'. One of '{"http://xml.netbeans.org/schema/Address":name}' is expected. [19]
    It complains <name> tag in <shipAddrss> needs namespace of "http://xml.netbeans.org/schema/Address". Why?
    Is it possible to change XML so it does not need name space for elements inside <shipAddress>?
    Thanks

    Hi Madhura,
    see here my comparison of the web version against the local file version on my Windows box (which is itself not the fastest): It makes a factor 16 in difference!
    C:\Temp\xsdvalidator>java XsdValidator madhu.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 16353 ms
    C:\Temp\xsdvalidator>java XsdValidator madhu_local.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 994 ms
    Obviously, the w3c.org domain that you specified as ressource location is very slow - and, as the FAQ shows, this delay is intentional!
    The W3C servers are slow to return DTDs. Is the delay intentional?
    Yes. Due to various software systems downloading DTDs from our site millions of times a day (despite the caching directives of our servers), we have started to serve DTDs and schema (DTD, XSD, ENT, MOD, etc.) from our site with an artificial delay. Our goals in doing so are to bring more attention to our ongoing issues with excessive DTD traffic, and to protect the stability and response time of the rest of our site. We recommend HTTP caching or catalog files to improve performance.
    --> They don't want to have requests to their site from productive servers all around the world.
    Regards,
    Rüdiger

  • XML validation against Schema

    Hi,
    We have SAP WebAS 6.20. Can someone help me understand how I can validate XML document against schema in ABAP.
    Thanks,
    Suman

    hi
    u can check the below links
    XML schema in ABAP
    Can i use XSD / XML in Abap Programs
    Regards,
    Naveen

Maybe you are looking for

  • Getting files off my pc to my mac. using an external hard drive

    i have brought a seagate hard drive. i am trying to get the stuff of my pc on to my mac. everytime i format the hard drive in the mac. i connect it to the pc and it says the drive needs formatting. i need help haha

  • Connecting New iPad (3) to vga projector

    Hi everyone Has anyone tried connecting a New iPad (3) to a projector using the vga adaptor? From what i've read, most projectors have a resolution of around 1028 x 768. What happens if you connect the New iPad, with it's 2048 x 1536 resolution, to a

  • Accounts Payables Workflows (Payment Authorisation)

    Good Afternoon, Does anyone know if there is a seeded workflow within accounts payable for the authorisation of payments? We are currently running 11.5.10 and following a re-structure we have a desire to print cheques, that are signed in the template

  • How to change '06-DEC-06  : Sites Converted From 005 To 001' to '06-Dec-06'

    hi all i have one requirement. Parameter : p_text1(80) type c value ‘06-DEC-06  : Sites Converted From 005 To 001’,             P_text2(80) type c value ‘As Country Has Move Off EST "RED" List’. Using below logic AT SELECTION-SCREEN.   TRANSLATE P_TE

  • Help syncing saved photos from itouch to computer

    When I connect my ipod to itunes, a little window used to always come up and ask if i want to sync my photos to my computer. But now when i connect my ipod the window doesnt come up anymore, how do i sync my pictures to my computer now?