XML Validation Errors?

Hi all,
I am parsing an XML file passed in at the cmd line and using this method to return a boolean if depending if the validation was ok....I have successfully validated against the particular file that I am passing in against a valid XSD and it works fine. But when I do this here it gets caught as an error straight away.
Can anyone see any obvious mistakes with this code or have any suggestions?
public boolean validateXML() {
        try {
        boolean validate = true;
        parser.setFeature("http://xml.org/sax/features/validation", validate);
        //CustomerErrorHandler extends SAX ErrorHandler
        CustomErrorHandler handler = new CustomErrorHandler();
        //Install/Enable the parser to handle parsing errors
        parser.setErrorHandler(handler);
        parser.parse(args[0]);
        System.out.println("YOU ARE IN THE XMLVALIDATOR CODE NOW!!!!");
        validXML = true;
        catch (Exception ex) {
            System.out.println("An error has been caught, following validation");
            validXML = false;
        return validXML;
    }

Hi thanks for the response,
I did not quite get what you meant from youre last post to this question. From what I understand from the lines you gave the following 3 lines need to be added to the class:
parser.setFeature("http://apache.org/xml/features/validation/schema", validate);parser.setFeature
("http://apache.org/xml/features/validation/schema-full-checking", validate);parser.setProperty
("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", schemaUrl);Then what I understood was to declare a String variable (schemaUrl) which is the actual location of the XML document? So in my case this would be "c://winnt/desktop/note.xml....
I was not clear on when you said:
XML document url (argv[0]) and schema document url should be file url:
file://c:/schema/xmldoc.xml
Thanks again,

Similar Messages

  • XML validation error while parsing MXI Manifest

    Hi,
    I have created an hybrid extension for Photoshop. I want to upload my extension on Adobe Exchange. during the upload process I get an error,
    "XML validation error while parsing MXI Manifest: Declarations can only occur in the doctype declaration. Line: 19 Position: 791 Last 80 unconsumed characters".
    The error description specifies that description in MXI file is not valid. Below are the contents of my MXI file.
    <macromedia-extension
               name="yyy"
               id="com.yyy"
               version="1.0.0"
               type="object"
               requires-restart="true">
              <author name="abcd" />
              <products>
              <product familyname="Photoshop" maxversion="" primary="true" version="12.0"/>  
              </products>
    <description>
              <![CDATA[
    <p><font size="14" color="black"><b>abcd</b> qwertyuioipafgjhkjljljklkjl
    <br><br>
    Open Extension via: Photoshop top menu > Window > Extensions > abcd.
    <br><br>
    Online support at: <a href="http://www.abcd.com/help.php">http://www.abcd.com/help.php</a></font></p>
    <br>]]>
    </description>
    <ui-access>
              </ui-access>
    <license-agreement>
    </license-agreement>
    <files>
                <file destination="$ExtensionSpecificEMStore/com.abcd/html/abcd.html" products="" source="zxp-support/Description/abcd.html"/>
                <file destination="$ExtensionSpecificEMStore/com.abcd/html/abcd.png" products="" source="zxp-support/Description/abcd.png"/>
                <file destination="" file-type="CSXS" products="" source="abcd.zxp"/> 
                <file destination="$automate" file-type="plugin" platform="mac" products="Photoshop" source="mac/abcd.plugin"/>
                <file destination="$automate" file-type="plugin" platform="win" products="Photoshop32" source="win32/abcd.8li"/>
                <file destination="$automate" file-type="plugin" platform="win" products="Photoshop64" source="win64/abcd.8li"/>
    </files>
    </macromedia-extension>
    Can anyone please point out why am I getting the error?
    Thanks

    Hi CarlSun,
    Thanks for the reply. I have made the changes suggested by you.
    I have few queries:
    1.  Can we use attribute "source" in the description tag?
         I have created a local html page and specified it in source attribute. but the Extension Manager CS6 did not render the local html page and displayed      the following:
         No description avaliable. Click the following link for more details.
         "http://www.abcd.html". Is it possible to display a local html page in Extension Manager CS6?
    2. Can I display an image (png) in CDATA under description tag? If yes, then can you please guide me how can I do so?
    3. As suggested in tech notes MXI file must include UTF-8 encoding as header (<?xml version="1.0" encoding="UTF-8"?>). The MXI I am using does      not have this header. Do I need to include the header?
    Thanks

  • XML validation errors in embedded OC4J jazn.xml

    hi
    If I open the jazn.xml of the embedded OC4J in JDeveloper 10.1.3.3.0 and select "Validate XML" from the context-menu on that file, I get these messages in the "XML Validation Errors - Log" :
    D:\oracle\jdevstudio10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\jazn.xml
        Error(10,28): <Line 10, Column 28>: XML-24535: (Error) Attribute 'schema-major-version' not expected.
        Error(10,28): <Line 10, Column 28>: XML-24535: (Error) Attribute 'schema-minor-version' not expected.
        Error(10,28): <Line 10, Column 28>: XML-24536: (Error) Missing Attribute 'filepath'
        Error(10,28): <Line 10, Column 28>: XML-24536: (Error) Missing Attribute 'OC4J_INSTANCE_ID'Strange, because I'm not aware of any changes I've made to this file.
    Could someone (from Oracle) please confirm that this is "intended", so I can exclude it as possible cause for the "security configuration issue" that I'm having.
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    If "the content seems to be correct" then the XML schema jazn-10_0.xsd might not be what it should be.
    For the attributes "filepath" and "OC4J_INSTANCE_ID" it says they are "required", just like the validation by JDeveloper says, but they are not in the documentation.
    For the attributes "schema-major-version" and "schema-minor-version" the documentation says:
    "This attribute is not defined directly in the XSD for jazn.xml. It is according to the attributeGroup specification in the top-level OC4J XSD."
    Although there is no exact reference in that documentation, and also not in jazn-10_0.xsd, that XSD could be oc4j-10_0.xsd because it defines this:
        <xsd:attributeGroup name="oc4j-schemaVersionAttributeType">
            <xsd:annotation>
                <xsd:documentation>This type defines two different attributes which are intended to be used in the
                    root element of a schema document to define version 10.0 of the schema document.
                </xsd:documentation>
            </xsd:annotation>
            <xsd:attribute name="schema-major-version" type="xsd:integer" fixed="10"/>
            <xsd:attribute name="schema-minor-version" type="xsd:integer" default="0"/>
        </xsd:attributeGroup>I'm not sure if it is the validation by JDeveloper that went wrong here, or the XML schema jazn-10_0.xsd that is incomplete about these "schema version" attributes.
    Anyway, it seems OK to exclude it as possible cause for the "security configuration issue" that I'm having.
    regards
    Jan

  • XML Validation error

    Hi,
    Version : 10.1.3.4
    Scenario : Extracting data from Oracle apps using DBAdapter and insert the same to a 3rd party application
    I am tring to use XMLtype.create function in a stored procedure to get the XML.The out parameter for the procedure is XMLtype. I tried to Call this PL/SQL procedure from the BPEL and getting the XML.Then i generated a XSD from this XML using third party tool(stylus) and tried to use it for parsing the XML in BPEL. But i am not able to Manipulate XML data as it is giving the below error.
    In this scenario i tried to Use Assign activity to copy the value from /ns3:PurchaseOrderRequest/ns3:OrderHeader/ns3:SEGMENT1 to string variable.But i am not able to do that, is there any solution for it?
    Error:
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"><part name="summary"><summary>empty variable/expression result.
    xpath variable/expression expression "/ns3:PurchaseOrderRequest/ns3:OrderHeader/ns3:SEGMENT1" is empty at line 107, when attempting reading/copying it.
    Please make sure the variable/expression result "/ns3:PurchaseOrderRequest/ns3:OrderHeader/ns3:SEGMENT1" is not empty.
    Possible reasons behind this problems are: some xml elements/attributes are optional or the xml data is invalid according to XML Schema.
    To verify whether XML data received by a process is valid, user can turn on validateXML switch at the domain administration page.
    </summary>
    </part></selectionFailure>
    The XML message i am getting From PL/SQL procedure in BPEL is
    <messages><Invoke_1_ss_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="InputParameters"><InputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XYZ_ASC_PKG/POCLOBOUT/">
    <ORDERNUM>4437</ORDERNUM>
    </InputParameters>
    </part></Invoke_1_ss_InputVariable><Invoke_1_ss_OutputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="OutputParameters"><OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XYZ_ASC_PKG/POCLOBOUT/">
    <RESULT>
    <PurchaseOrderRequest xmlns="">
    <OrderHeader num="1">
    <PO_HEADER_ID>32906</PO_HEADER_ID>
    <SEGMENT1>4437</SEGMENT1>
    <AGENT_ID>25</AGENT_ID>
    <LAST_UPDATE_DATE>11/28/2008 0:20:35</LAST_UPDATE_DATE>
    <TYPE_LOOKUP_CODE>STANDARD</TYPE_LOOKUP_CODE>
    <TERMS_ID>10002</TERMS_ID>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <RATE_DATE>11/28/2008 0:0:0</RATE_DATE>
    <REVISION_NUM>0</REVISION_NUM>
    <CONFIRMING_ORDER_FLAG>N</CONFIRMING_ORDER_FLAG>
    <ACCEPTANCE_REQUIRED_FLAG>N</ACCEPTANCE_REQUIRED_FLAG>
    <FIRM_STATUS_LOOKUP_CODE>N</FIRM_STATUS_LOOKUP_CODE>
    <FROZEN_FLAG>N</FROZEN_FLAG>
    <ORG_ID>204</ORG_ID>
    <CURRENCY_CODE>USD</CURRENCY_CODE>
    <CREATION_DATE>11/28/2008 0:17:50</CREATION_DATE>
    <LANG>en-US</LANG>
    <LINE>
    <LINE_ROW num="1">
    <PO_LINE_ID>38176</PO_LINE_ID>
    <LINE_NUM>2</LINE_NUM>
    <LINE_TYPE_ID>1</LINE_TYPE_ID>
    <ITEM_DESCRIPTION>TEST1</ITEM_DESCRIPTION>
    <UNIT_MEAS_LOOKUP_CODE>Each</UNIT_MEAS_LOOKUP_CODE>
    <ISO_UOM>Ea</ISO_UOM>
    <UNIT_PRICE>200</UNIT_PRICE>
    <QUANTITY>200</QUANTITY>
    <ORG_ID>204</ORG_ID>
    <COMMODITYCODE>MISC:MISC</COMMODITYCODE>
    <DESCRIPTION>Miscellaneous</DESCRIPTION>
    <LAST_UPDATE_DATE>2/19/1997 0:0:0</LAST_UPDATE_DATE>
    <CATEGORY_ID>1</CATEGORY_ID>
    <LINELOCATION>
    <LINELOCATION_ROW num="1">
    <LINE_LOCATION_ID>72552</LINE_LOCATION_ID>
    <QUANTITY>200</QUANTITY>
    <QUANTITY_RECEIVED>0</QUANTITY_RECEIVED>
    <QUANTITY_ACCEPTED>0</QUANTITY_ACCEPTED>
    <QUANTITY_REJECTED>0</QUANTITY_REJECTED>
    <QUANTITY_BILLED>0</QUANTITY_BILLED>
    <SHIP_TO_ORGANIZATION_ID>1884</SHIP_TO_ORGANIZATION_ID>
    <SHIPMENT_NUM>1</SHIPMENT_NUM>
    <CLOSED_CODE>OPEN</CLOSED_CODE>
    <SHIPTOLOCATIONID>2402</SHIPTOLOCATIONID>
    <SHIPTOLOCATIONCODE>W1 - Cherry Hill</SHIPTOLOCATIONCODE>
    <SHIPTOLOCATIONUSE>HR</SHIPTOLOCATIONUSE>
    <SHIPTOTELEPHONENUMBER1>0</SHIPTOTELEPHONENUMBER1>
    <SHIPTODESCRIPTION>W1 - Cherry Hill Distribution</SHIPTODESCRIPTION>
    <SHIPTOADDRESSLINE1>8756 Benjamin Franklin Boulevard</SHIPTOADDRESSLINE1>
    <SHIPTOTERRITORY>United States</SHIPTOTERRITORY>
    <SHIPTOTOWNORCITY>Cherry Hill</SHIPTOTOWNORCITY>
    <SHIPTOCOUNTRY>US</SHIPTOCOUNTRY>
    <SHIPTOPOSTALCODE>08003</SHIPTOPOSTALCODE>
    <SHIPTOREGION1>Camden</SHIPTOREGION1>
    <SHIPTOREGION2>NJ</SHIPTOREGION2>
    <DISTRIBUTIONS>
    <DISTRIBUTIONS_ROW num="1">
    <PO_DISTRIBUTION_ID>74376</PO_DISTRIBUTION_ID>
    <CODE_COMBINATION_ID>17347</CODE_COMBINATION_ID>
    <QUANTITY_ORDERED>200</QUANTITY_ORDERED>
    <QUANTITY_DELIVERED>0</QUANTITY_DELIVERED>
    <DESTINATION_ORGANIZATION_ID>1884</DESTINATION_ORGANIZATION_ID>
    </DISTRIBUTIONS_ROW>
    </DISTRIBUTIONS>
    </LINELOCATION_ROW>
    </LINELOCATION>
    </LINE_ROW>
    <LINE_ROW num="2">
    <PO_LINE_ID>38175</PO_LINE_ID>
    <LINE_NUM>1</LINE_NUM>
    <LINE_TYPE_ID>1</LINE_TYPE_ID>
    <ITEM_DESCRIPTION>test</ITEM_DESCRIPTION>
    <UNIT_MEAS_LOOKUP_CODE>EA</UNIT_MEAS_LOOKUP_CODE>
    <ISO_UOM>EA</ISO_UOM>
    <UNIT_PRICE>100</UNIT_PRICE>
    <QUANTITY>100</QUANTITY>
    <ORG_ID>204</ORG_ID>
    <COMMODITYCODE>MISC:MISC</COMMODITYCODE>
    <DESCRIPTION>Miscellaneous</DESCRIPTION>
    <LAST_UPDATE_DATE>2/19/1997 0:0:0</LAST_UPDATE_DATE>
    <CATEGORY_ID>1</CATEGORY_ID>
    <LINELOCATION>
    <LINELOCATION_ROW num="1">
    <LINE_LOCATION_ID>72551</LINE_LOCATION_ID>
    <QUANTITY>100</QUANTITY>
    <QUANTITY_RECEIVED>0</QUANTITY_RECEIVED>
    <QUANTITY_ACCEPTED>0</QUANTITY_ACCEPTED>
    <QUANTITY_REJECTED>0</QUANTITY_REJECTED>
    <QUANTITY_BILLED>0</QUANTITY_BILLED>
    <SHIP_TO_ORGANIZATION_ID>1884</SHIP_TO_ORGANIZATION_ID>
    <SHIPMENT_NUM>1</SHIPMENT_NUM>
    <CLOSED_CODE>OPEN</CLOSED_CODE>
    <SHIPTOLOCATIONID>2402</SHIPTOLOCATIONID>
    <SHIPTOLOCATIONCODE>W1 - Cherry Hill</SHIPTOLOCATIONCODE>
    <SHIPTOLOCATIONUSE>HR</SHIPTOLOCATIONUSE>
    <SHIPTOTELEPHONENUMBER1>0</SHIPTOTELEPHONENUMBER1>
    <SHIPTODESCRIPTION>W1 - Cherry Hill Distribution</SHIPTODESCRIPTION>
    <SHIPTOADDRESSLINE1>8756 Benjamin Franklin Boulevard</SHIPTOADDRESSLINE1>
    <SHIPTOTERRITORY>United States</SHIPTOTERRITORY>
    <SHIPTOTOWNORCITY>Cherry Hill</SHIPTOTOWNORCITY>
    <SHIPTOCOUNTRY>US</SHIPTOCOUNTRY>
    <SHIPTOPOSTALCODE>08003</SHIPTOPOSTALCODE>
    <SHIPTOREGION1>Camden</SHIPTOREGION1>
    <SHIPTOREGION2>NJ</SHIPTOREGION2>
    <DISTRIBUTIONS>
    <DISTRIBUTIONS_ROW num="1">
    <PO_DISTRIBUTION_ID>74375</PO_DISTRIBUTION_ID>
    <CODE_COMBINATION_ID>17347</CODE_COMBINATION_ID>
    <QUANTITY_ORDERED>100</QUANTITY_ORDERED>
    <QUANTITY_DELIVERED>0</QUANTITY_DELIVERED>
    <DESTINATION_ORGANIZATION_ID>1884</DESTINATION_ORGANIZATION_ID>
    </DISTRIBUTIONS_ROW>
    </DISTRIBUTIONS>
    </LINELOCATION_ROW>
    </LINELOCATION>
    </LINE_ROW>
    </LINE>
    <VENDOR_ID>1595</VENDOR_ID>
    <VENDOR_NAME>Agile Electronic Supplies</VENDOR_NAME>
    <PAYMENT_METHOD_LOOKUP_CODE>CHECK</PAYMENT_METHOD_LOOKUP_CODE>
    <VENDOR_SITE_CODE>SANTA ROSA-USE</VENDOR_SITE_CODE>
    <ADDRESS_LINE1>22800 Corby Avenue</ADDRESS_LINE1>
    <BILL_TO_LOCATION_ID>2402</BILL_TO_LOCATION_ID>
    <VENDORTERRITORY>United States</VENDORTERRITORY>
    <VENDORCONTACT>
    <VENDORCONTACT_ROW num="1">
    <VENDOR_CONTACT_ID>2485</VENDOR_CONTACT_ID>
    <FIRST_NAME>Li</FIRST_NAME>
    <LAST_NAME>Wang</LAST_NAME>
    <AREA_CODE>707</AREA_CODE>
    <PHONE>638-7814</PHONE>
    </VENDORCONTACT_ROW>
    </VENDORCONTACT>
    <SHIPTOLOCATIONID>2402</SHIPTOLOCATIONID>
    <SHIPTOLOCATIONCODE>W1 - Cherry Hill</SHIPTOLOCATIONCODE>
    <SHIPTOLOCATIONUSE>HR</SHIPTOLOCATIONUSE>
    <SHIPTOTELEPHONENUMBER1>0</SHIPTOTELEPHONENUMBER1>
    <SHIPTODESCRIPTION>W1 - Cherry Hill Distribution</SHIPTODESCRIPTION>
    <SHIPTOADDRESSLINE1>8756 Benjamin Franklin Boulevard</SHIPTOADDRESSLINE1>
    <SHIPTOTERRITORY>United States</SHIPTOTERRITORY>
    <SHIPTOTOWNORCITY>Cherry Hill</SHIPTOTOWNORCITY>
    <SHIPTOCOUNTRY>US</SHIPTOCOUNTRY>
    <SHIPTOPOSTALCODE>08003</SHIPTOPOSTALCODE>
    <SHIPTOREGION1>Camden</SHIPTOREGION1>
    <SHIPTOREGION2>NJ</SHIPTOREGION2>
    <BILLTOLOCATIONID>2402</BILLTOLOCATIONID>
    <BILLTOLOCATIONCODE>W1 - Cherry Hill</BILLTOLOCATIONCODE>
    <BILLTOLOCATIONUSE>HR</BILLTOLOCATIONUSE>
    <BILLTOTELEPHONENUMBER1>0</BILLTOTELEPHONENUMBER1>
    <BILLTODESCRIPTION>W1 - Cherry Hill Distribution</BILLTODESCRIPTION>
    <BILLTOADDRESSLINE1>8756 Benjamin Franklin Boulevard</BILLTOADDRESSLINE1>
    <BILLTOTERRITORY>United States</BILLTOTERRITORY>
    <BILLTOTOWNORCITY>Cherry Hill</BILLTOTOWNORCITY>
    <BILLTOCOUNTRY>US</BILLTOCOUNTRY>
    <BILLTOPOSTALCODE>08003</BILLTOPOSTALCODE>
    <BILLTOREGION1>Camden</BILLTOREGION1>
    <BILLTOREGION2>NJ</BILLTOREGION2>
    </OrderHeader>
    </PurchaseOrderRequest>
    </RESULT>
    </OutputParameters>
    </part></Invoke_1_ss_OutputVariable></messages>
    Thanks
    Sen

    Forwarded to developers.

  • Xml validation error, pls help

    I try to use the following way to validate my xml file with one schema.
    // parse an XML document into a DOM tree
    DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document document = parser.parse(new File("instance.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
    Source schemaFile = new StreamSource(new File("mySchema.xsd"));
    Schema schema = factory.newSchema(schemaFile);
    // create a Validator instance, which can be used to validate an instance document
    Validator validator = schema.newValidator();
    // validate the DOM tree
    try {
    validator.validate(new DOMSource(document));
    } catch (SAXException e) {
    // instance document is invalid!
    got the error message like SAXException: http://www.w3.org/TR/xml-schema-1#cvc-type.3.1.1?
    i am very confused. what can be the problem?
    Thanks very much.

    <?xml version="1.0" encoding="UTF-8"?>
    <dataset xmlns="xx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="xx yy.xsd">
    <heading xsi:type="PW_Heading" datasetId="PW_2005-08-22_18-34-58.pts" generationDate="2005-08-22T16:35:00Z" providerId="PW"/>
    <eventCommands>
    <DEFINE>
    <siEvent xsi:type="KRIMI_SiEventDefinition" eventId="KRIMI_0000177732121_SI" serviceId="KRIMI" programId="KRIMI_0000177732121"
    startTime="2005-08-23T03:52:15Z" duration="00 00:48:54.000" title="SOKO Leipzig" comment="#SG:1" triggerType="TIMED">
    </siEvent>
    </DEFINE>
    </eventCommands>
    </dataset>
    This should be output xml which can be validated.
    the schema for heading and siEvent is:
    <xs:complexType name="Heading" abstract="true">
              <xs:attribute name="generationDate" type="xs:dateTime" use="required"/>
              <xs:attribute name="datasetId" type="Token30" use="required"/>
              <xs:attribute name="providerId" type="Token10" use="required"/>
         </xs:complexType>
    <xs:complexType name="SiEventDefinition" abstract="true">
              <xs:choice>
                   <xs:element name="siStandard" type="SiStandardDefinition"/>
                   <xs:element name="siReference" type="SiReferenceDefinition"/>
                   <xs:element name="siTimeshift" type="SiTimeshiftDefinition"/>
              </xs:choice>
              <xs:attributeGroup ref="EventPropertyDefinition"/>
         </xs:complexType>
    now my output xml is:
    <?xml version="1.0" encoding="UTF-8"?>
    <dataset >
    <heading datasetId="PW_2005-08-22_18-34-58.pts" generationDate="2005-08-22T16:35:00Z" providerId="PW"/>
    <eventCommands>
    <DEFINE>
    <siEvent eventId="KRIMI_0000177732121_SI" serviceId="KRIMI" programId="KRIMI_0000177732121"
    startTime="2005-08-23T03:52:15Z" duration="00 00:48:54.000" title="SOKO Leipzig" comment="#SG:1" triggerType="TIMED">
    </siEvent>
    </DEFINE>
    </eventCommands>
    </dataset>
    my problem is: i dont know how to generate these attributes in dataset, and how to generate the xsi:type attribute in heading and siEvent.
    Thanks in advance.

  • IS - XML validation error for file task.xml. (COR-10142)

    Hi,
    I am facing an issue while running column profile task on a text file.
    Version of BODS components below:
    IPS: IPS 4.1 SP2
    DS: DS 4.2 SP1
    IS: IS 4.2 SP1(14.2.1.220)
    All the above components are installed on linux RHEL 6.5 machine(single machine).
    Attached the error log file.
    Appreciate the quick response.
    Thanks,
    Lokesh

    Hi Lokesh,
    Check the KBA  1931128 which may help you to resolve your issue.
    Thanks,
    Ramakrishna Kamurthy

  • XML Validation - How to raise an alert

    Hi PI Experts,
    I enabled XML validation at "Validtion by Adapetr Engine". Its working fine. But how to integrate XML validation error with Alert Monitoring. Please advise.
    Here below the error from Audit log:
    2010-03-18 18:33:13     Information     The application tries to send an XI message asynchronously using connection File_http://sap.com/xi/XI/System.
    2010-03-18 18:33:13     Information     Backward validation is enabled
    2010-03-18 18:33:13     Error     Unable to validate the message with message ID b01d356e-1801-4b93-29fb-9ed84b25c6a3
    2010-03-18 18:33:13     Error     Returning to application. Exception: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: cvc-enumeration-valid: Value '11' is not facet-valid with respect to enumeration '[1, 2, 3, 4, 5, 6, 7]'. It must be a value from the enumeration. at line 15, column 34
    2010-03-18 18:33:13     Error     MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: cvc-enumeration-valid: Value '11' is not facet-valid with respect to enumeration '[1, 2, 3, 4, 5, 6, 7]'. It must be a value from the enumeration. at line 15, column 34
    2010-03-18 18:33:13     Error     File processing failed with com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: cvc-enumeration-valid: Value '11' is not facet-valid with respect to enumeration '[1, 2, 3, 4, 5, 6, 7]'. It must be a value from the enumeration. at line 15, column 34
    Thanks...
    Ravi Kanakam

    Hi Ravi,
    Are you getting other adapter engine alerts? Or only you are not getting xml validation ones? Also take a look at this:
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
    Regards,
    ---Satish

  • Weird attribute validation error

    Hi!
    I'm trying to get an XML message to validate in Spring WS. I have the following XML Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema version="1.0"
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               elementFormDefault="qualified"
               targetNamespace="http://namespace.lantmateriet.se/distribution/products/geoaccess/admindirekt/v1"
               xmlns:app="http://namespace.lantmateriet.se/distribution/products/geoaccess/admindirekt/v1">
      <xs:element name="FindCountyRequest">
        <xs:complexType>
          <xs:choice>
            <xs:element name="id" type="xs:string"  form="unqualified"/>
            <xs:element name="name" type="xs:string"  form="unqualified"/>
          </xs:choice>
          <xs:attribute name="detail" use="required">
              <xs:simpleType>
                  <xs:restriction base="xs:string">
                      <xs:enumeration value="GENERAL"/>
                      <xs:enumeration value="DETAILED"/>
                  </xs:restriction>
              </xs:simpleType>
          </xs:attribute>
        </xs:complexType>
      </xs:element>
    </xs:schema>When I send the following message...:
    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
                   xmlns:app="http://namespace.lantmateriet.se/distribution/products/geoaccess/admindirekt/v1"
       <soap:Header/>
       <soap:Body>
          <app:FindCountyRequest detail="DETAILED">
             <id>21</id>
          </app:FindCountyRequest>
       </soap:Body>
    </soap:Envelope>...I get this error:
    WARN  XML validation error on request: cvc-complex-type.3.2.2: Attribute 'detail' is not allowed to appear in element 'app:FindCountyRequest'. at org.springframework.ws.soap.server.endpoint.interceptor.AbstractFaultCreatingValidatingInterceptor.handleRequestValidationErrors(AbstractFaultCreatingValidatingInterceptor.java:154)
    WARN  XML validation error on request: cvc-complex-type.4: Attribute 'detail' must appear on element 'app:FindCountyRequest'. at org.springframework.ws.soap.server.endpoint.interceptor.AbstractFaultCreatingValidatingInterceptor.handleRequestValidationErrors(AbstractFaultCreatingValidatingInterceptor.java:154)What?! How come it says that I must have the attribute and that, at the same time, it is not allowed?
    Any ideas?
    Thanks!

    I've come to the conclusion that the attribute is in the wrong namespace.
    How do I fix the schema so that the message validates?

  • Validation error when using env-entry in web.xml

    I've added an env-entry element to my web.xml and it falls over at deploy time with a validation error. However, from what I can see, this is valid based on the schema.
    And infact, it matches the example in the weblogic doco - http://edocs.bea.com/wls/docs103/webapp/web_xml.html#wp1025195
    The error I'm getting is:
    <17/12/2008 11:45:56 AM EST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor D:\workspace\source_checkout\investment_control\ic-web\src\main\webapp/WEB-INF/web.xml of module ic-web.war. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
    problem: cvc-complex-type.2.4a: Expected elements 'mapped-name@http://java.sun.com/xml/ns/javaee injection-target@http://java.sun.com/xml/ns/javaee' instead of 'env-entry-type@http://java.sun.com/xml/ns/javaee' here in element env-entry@http://java.sun.com/xml/ns/javaee:<null>
         at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
         at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
    My web.xml looks like:
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
         <description>IC Web</description>
         <env-entry>
              <env-entry-name>aEntry</env-entry-name>
              <env-entry-value>aValue</env-entry-value>
              <env-entry-type>java.lang.String</env-entry-type>
         </env-entry>
    </web-app>
    Any suggestions???

    Found a resolution to this in the end.
    Unless you have the sub-elements in the order below, it will get validation errors.
    <env-entry>
    <env-entry-name>maxAmount</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>aString</env-entry-value>
    </env-entry>
    A bit weird and very frustrating....

  • Java.lang.Exception error during XML validation by Integration Engine

    Hi professionals,
    We are trying to use XML validation by the Integration Engine.
    Step 1:
    We created an appropriate directory structure where we had to store the structure (xsd).
    \usr\sap\<system id>\SYS\global\xi\runtime_server\A\B\C\D\E\F
    A - validation
    B - schema
    C - GUID of the SWCV where service interface reside.
    D - Repository Namespace where Service Interface is created.
    E - Service Interface Name
    F - Repository Namespace where Message Type or External Definition is
    assigned.
    Step 2:
    We also changed the references in the xsd to exclude all the subdirectory references.
    e.g folder1/folder2/abc.xsd is become abc.xsd only
    Step 3:
    We stored both xsdu2019s (schema xsd and referenced xsd to the directory created in step 1)
    Step 4:
    We changed the directory and xsdu2019s permissions to 777 (we chose 777 for testing purpose).
    Step 5:
    We changed the property schema validation of the sender agreement to Validation by Integration Engine.
    Step 6:
    We checked RFC destination for AI_VALIDATION_JCOSERVER on AS ABAP and AS Java and establish an successful connection test.
    RESTULTS
    The result of those steps is an error message in the message monitor of PI with the error tekst:
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="XML_VALIDATION_INB">CX_XMS_SYSERR_VALIDATION</SAP:Code>
      <SAP:P1>java.lang.Exception</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>not used at the moment.</SAP:AdditionalText>
      <SAP:Stack>System error occurred during XML validation</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Please assist in how to solve this issueu2026.
    Regards, Sjaak.

    I would suggest follow Appendix A to know the exact path and since you have one XSD referring other XSD check the steps mentioned in Appendix B .... there seems to be some error in referencing ...Appendix A and B are on page 12 & 13 of this document:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d06dff94-9913-2b10-6f82-9717d9f83df1?quicklink=index&overridelayout=true
    Regards,
    Abhishek.

  • XML Schema validation error in network configuration. Missing DnsRef

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

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

  • Ejb-jar.xml DTD validation error?

    I am attempting to deploy a JAR on App Server 8 PE. The application does not contain any EJBs but I understand that the ejb-jar.xml descriptor is still needed. I am running the app server on Windows XP.
    My issue is as follows:
    I understand that the root element for the ejb-jar.xml file (<ejb-jar>) is required. Since I have no EJBs, I should be able to leave this root element blank (as I have in previoius successful deployments to earlier versions of Sun App Server). When I attempt to deploy, I receive the following DTD Validation error via the admin console:
    The content of element type "ejb-jar" is incomplete, it must match "(description?,display-name?,small-icon?,large-icon?,enterprise-beans,relationships?,assembly-descriptor?,ejb-client-jar?)".
    Am I missing something?
    My ejb-jar.xml file looks like:
    <!DOCTYPE ejb-jar PUBLIC
         "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
         "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    </ejb-jar>
    Many thanks in advance to any assistance...

    I am attempting to deploy a JAR on App Server 8 PE.
    The application does not contain any EJBs but I
    I understand that the ejb-jar.xml descriptor is still
    needed. I am running the app server on Windows XP.
    My issue is as follows:
    I understand that the root element for the
    ejb-jar.xml file (<ejb-jar>) is required. Since I
    have no EJBs, I should be able to leave this root
    element blank (as I have in previoius successful
    deployments to earlier versions of Sun App Server).
    When I attempt to deploy, I receive the following
    g DTD Validation error via the admin console:
    The content of element type "ejb-jar" is incomplete,
    it must match
    "(description?,display-name?,small-icon?,large-icon?,e
    nterprise-beans,relationships?,assembly-descriptor?,ej
    b-client-jar?)".
    Am I missing something?
    My ejb-jar.xml file looks like:
    <!DOCTYPE ejb-jar PUBLIC
    "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    s 2.0//EN"
         "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    </ejb-jar>
    Many thanks in advance to any assistance...I hav tried this and it is working
    <?xml version="1.0" encoding="UTF-8" ?>
    <ejb-jar
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
    version="2.1">

  • Regarding error in xml validation in 7.1

    Hi
    I am getting following error in xml validation in 7.1
    my scenario is IDOC TO FILE
    from idoc DATE_TIME field comes with 14 digits. In the target I created DATE_TYPE field with data type
    "dateTime" and in details column pattern section I mentioned yyyyMMddHHmmss.while doing xml validation in I am gettting this error:(xml validation done in receiver agreement validation by Integrtion engine)
    cvc-pattern-valid: Value '20080213081220' is not facet-valid with respect to pattern 'yyyyMMddHHmmss' for type 'null'
    Please give me some inputs on this.
    Regards
    venkat.

    Hi,
    try this - update your target msg xsd in your XI folder........rerun your scenario and see if this error is still there..........
    if this error remains same, then in IR in data type, remove your pattern and just keep dateTime as datatype.......again update your xsd in XI folder.........rerun your scenario.
    Regards,
    Rajeev Gupta

  • Regarding error in xml validation 7.1

    Hi
    I am doing file to idoc scenario. In the sender agreement i selected validation by Adapter and uploaded the particular xsd.after executing the scenario in runtime workbench it is showing sucessfully processed  but in the MDT audit log I am getting following error.without validation the file is posting in target system.but when I check the validation by adapter it is giving following error.
    Received XI System Error. ErrorCode: CX_XMS_SYSERR_VALIDATION ErrorText: not used at the moment. ErrorStack: System error occurred during XML validation
    Transmitting the message to endpoint http://orcdapp1.edfapps.edfenergy.net:51100/sap/xi/engine?type=entry using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: CX_XMS_SYSERR_VALIDATION:not used at the moment..
    Please give me your inputs.
    Regards
    venkat.

    Hi Venky,
    This error due to incorrect path So please check whether you have used the correct path or not?
    Create appropriate directories structure where we have to save your structure (xsd).
    \usr\sap\<system id>\SYS\global\xi\runtime_server\A\B\C\D\E\F
    A - validation
    B - schema
    C - GUID of the SWCV where service interface reside.
    D - Repository Namespace where Service Interface is created.
    E - Service Interface Name
    F - Repository Namespace where Message Type or External Definition is assigned.
    Note: if your ESR namespace contains special character then do replace it with u201C~u201D in folder name.
    If namespace is http://abc.com/XI/FileToFile then folder name should be replace with httpabc.comXI~FileToFile
    Export schema from the ESR and save it in folder u201CFu201D with name <<RootElementOfMessageType>>.xsd. So in this case it is MT_File_Sender.xsd
    Regards,
    Sameer
    Edited by: sameer Khanna on May 27, 2009 10:14 AM

  • Get errors of a xml validation from xsd file

    hi everyone,
    i created a xml validation from a XSD file as follow:
    public String validate(String xml) {
            String saida = "";
            InputStream xsd = XmlValidator.class.getResourceAsStream("shiporder.xsd");       
            try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                docBuilderFactory.setNamespaceAware(true);
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes());
                Document doc = docBuilder.parse(is);
                SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                Source schemaFile = new StreamSource(xsd);
                Schema newSchema = (Schema) factory.newSchema(schemaFile);
                Validator validator = newSchema.newValidator();
                validator.validate(new DOMSource(doc));           
                saida = "SUCESSO";
            } catch (DOMException ex) {           
                ex.printStackTrace();
                saida =  "DOM";
            } catch (SAXException ex) {           
                saida = ex.getMessage();
            } catch (IOException ex) {           
                ex.printStackTrace();
                saida =  "IO";
            } catch (ParserConfigurationException ex) {           
                ex.printStackTrace();
                saida = "PARSER_CONFIGURATION";
            return saida;
        }this code works perfectly, but i must change one thing.
    When is found a error on a xml structure, one exception is threw, and then the method is finalized. However i need to show up all errors on one shot.
    Because right now when i run and it find a error, the method throw an exception an stop, so i have to adjust, then execute again and adjust another repeatedly until everything is right, so i have to change that.
    Anyone could help me?
    thanks in advance

    That's the rule for XML validation. As soon as the parser finds an error, it must report it and stop.
    If you are having a lot of trouble creating an XML document which conforms to a schema, perhaps you should invest in one of those XML editors which supports validation as you enter the document.

Maybe you are looking for

  • How can I create my own tag name while creating a partition table.

    I have X4500 running Solaris 10. I have formatted a disk and created partition table as given below. Specify disk (enter its number): 0 selecting c0t0d0 [disk formatted] /dev/dsk/c0t0d0s0 is part of active ZFS pool zpool1. Please see zpool(1M). FORMA

  • OT: Did you know you can change your profile to show your real name, rather than just your Adobe ID?

    I realize this is off-topic for this particular forum, but I hope it may help some readers. Since this forum is "where I live" in the Adobe forums, I wanted top share it here first. Perhaps after some feedback to refine things, I may post it elsewher

  • Windows Multipoint Server Station Connection Issue

    I'm trying to join our Windows Multipoint Server (2012 Premium) to our domain.  After joining the server to our domain and restarting the server, I receive the following message when the primary station begins to load. The station is attempting to co

  • Some of macbook pros display lights not working???

    i recently went to beijing with my macbook pro, by air. After i came back to shanghai i went to open my macbook pro once i got home from the airport. Something weird happened, when i opened the macbook pro the display had long black lines going verti

  • Batch replace color with another color

    Hi, I would desperately need some assistance in trying to accomplish batch editing of ai-files via JavaScript. What I would need to do, is go through a number (many!) of files, find items with certain swatch color (referenced by its name), and replac