Parse file without xml specification or document element

I have a large (600mb) log file that is in xml format but it does not have an xml specification and has no document element.
file looks like this:
<message>...</message>
<message>...</message>
<!-- ... many many many more <message> elements -->
<message>...</message>
<message>...</message>
I have written a class that overrides the SAX DefaultHandler but now want to be able to parse the document without having to add the xml spec and document element manually.
I've thought about writing a subclass of FileReader that adds the xml specification and document element before reading physical file but would also need to add closing document element at end of file.
Is there a simpler way?

Hi,
There is another way around the problem of adding a missing root node. This involves adding an extra DTD file and a xml file, like this one:
<?xml version='1.0' encoding='UTF-8' standalone="no"?>
<!DOCTYPE messageSet SYSTEM "logfile.dtd"
[<!ENTITY data SYSTEM "logfile.xml">]
>
<messageSet>
&data;
</messageSet>
This file "includes" the logfie.xml, as an external entity, with your messages as child nodes of element messageSet.
In your program you refer to this xml file when parsing the messages.

Similar Messages

  • IDOC to flat file without XML conversion

    Hi,
    I want to implement a scenario like this:
    IDOC --> XI --> flat file
    The flat file has to have the IDOC structure as you have when you write an IDOC to the R/3 file port. But we want to have this process running through XI.
    When you use the IDOC Adapter the IDOC is converted to XML first, which is time consuming. So this I want to skip this step.
    So is it possible to receive the IDOC directly in XI without converting it to XML? How should this process be designed.
    Ron

    Ron
    Looks like you need IDOC tunneling. It is possible by making a configuration parameter.
    You can find more information in http://help.sap.com/saphelp_nw04/helpdata/en/ab/bdb13b00ae793be10000000a11402f/content.htm
    While you try it, I will try to simulate this requirement in our system and let you know the result.
    KK

  • Problem in Coverting XML String into Document

    Hi,
    I am getting some problem while parsing a String XML in to Document object.
    CODE :
    public static Document converDocument(String xml){
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;
    try {
    builder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
    e.printStackTrace();
    Document document = null;
    try {
    document = builder.parse(new InputSource(new StringReader(xml)));
    System.out.println("Document is after parsing ====>>>"+document);
    } catch (SAXException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    } catch (IOException e1) {
    e1.printStackTrace();
    return document;
    The xml which I am passing is :
    <?xml version="1.0" encoding="UTF-8"?>
    <note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>abc</body>
    </note>
    It is giving the document as null;
    Can anybody please help?
    Regards,
    sheeetal.

    >
    Vikas Sridharan wrote:

    >       CALL TRANSFORMATION ('ID')
    >       SOURCE XML = lv_output_str "<============ ERRONEOUS = HERE
    >       RESULT ref = <fst_dyn_table> .
    >
    Remove the "=" sign, this code will work :
          CALL TRANSFORMATION ('ID')
          SOURCE XML lv_output_str
          RESULT ref = <fst_dyn_table> .

  • End of XML file without root element

    how can i know when the end of a XML file is reached if there is no root element, im using kxml.
    <element id="12" nom="dan"/>
    <element id="32" nom="eco"/>
    <element id="34" nom="juar"/>i can parse it without no problem but when it reaches the last element it throws an exception when calling to nextTag() method, how can i knwo when stoping reading...
    while(???????????)
    code....
    }

    Read the document with DOM, and append the new children, then use an empty transformer to write ti out.

  • Generating a File from ESB or BPEL without XML Elements

    Is there a way to generate a file without the XML tags using a FTP or File adapter in BPEL or ESB? Basically what I need to do is create a CSV file with a header row but without the XML tags. Below is an example. Thanks for any help you can provide.
    Now:
    <?xml version="1.0" ?>
    <theFile xmlns="http://oracle.com/">
    FIRST_NAME,LAST_NAME,MIDDLE_NAME
    Jim,Smith,L
    Tom,Murphy,T
    Patty,Miller,A
    </theFile>
    Need:
    FIRST_NAME,LAST_NAME,MIDDLE_NAME
    Jim,Smith,L
    Tom,Murphy,T
    Patty,Miller,A

    hi todd_thomas
    If you apply an XSL styleheet like this ...
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text"/>
    <xsl:template match="/"><xsl:value-of select="."/></xsl:template>
    </xsl:stylesheet>... to an xml file like this ...
    <?xml version="1.0" ?>
    <theFile xmlns="http://oracle.com/">FIRST_NAME,LAST_NAME,MIDDLE_NAME
    Jim,Smith,L
    Tom,Murphy,T
    Patty,Miller,A</theFile>... you get output like this ...
    FIRST_NAME,LAST_NAME,MIDDLE_NAME
    Jim,Smith,L
    Tom,Murphy,T
    Patty,Miller,Asuccess
    Jan Vervecken

  • CORE3282: stdout: org.xml.sax.SAXParseException: Document root element

    I got an application running on Sun ONE Web Server 6.1SP5, during the application start, I got the following message. The application can run without any problem. I would like to know if there is any solution to avoid the PARSE error? Thanks a lot.
    [01/Aug/2006:11:42:09] info (21921):      CORE1116: Sun ONE Web Server 6.1SP5 B08/18/2005 02:17
    [01/Aug/2006:11:42:09] info (21923):      CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.4.2_04] from [Sun Microsystems Inc.]
    [01/Aug/2006:11:42:09] info (21923):      WEB0100: Loading web module in virtual server [https-sunfire] at [myapp]
    [01/Aug/2006:11:42:09] info (21923):      WEB0100: Loading web module in virtual server [https-sunfire] at [search]
    [01/Aug/2006:11:42:13] info (21923):      CORE3282: stdout: PARSE error at line 6 column 19
    [01/Aug/2006:11:42:13] info (21923):      CORE3282: stdout: org.xml.sax.SAXParseException: Document root element "taglib", must match DOCTYPE root "null".
    [01/Aug/2006:11:42:13] info (21923):      WEB2798: [myapp] ServletContext.log(): Loading Spring root WebApplicationContext
    [01/Aug/2006:11:42:18] info (21923):      WEB2798: [myapp] ServletContext.log(): Loading WebApplicationContext for Spring FrameworkServlet 'action'
    [01/Aug/2006:11:42:18] info (21923):      HTTP3072: [LS ls1] http://sunfire:9999 ready to accept requests
    [01/Aug/2006:11:42:18] info (21923):      CORE3274: successful server startup

    That doesn't say much. Which is this xml file? and what have you given in the <!DOCTYPE > tag? Probably, that is the mistake...

  • Org.xml.sax.SAXParseException: Document root element is missing.

    Hi,
    I am trying to get the portal login id from a weblogic server based application from iplaet portal server.
    I get this follwoing error
    org.xml.sax.SAXParseException: Document root element is missing.
    at com.sun.xml.parser.Parser.fatal(Parser.java:2817)
    at com.sun.xml.parser.Parser.fatal(Parser.java:2805)
    at com.sun.xml.parser.Parser.parseInternal(Parser.java:493)
    at com.sun.xml.parser.Parser.parse(Parser.java:284)
    at com.sun.xml.tree.XmlDocument.createXmlDocument(XmlDocument.java:226)
    at com.iplanet.portalserver.util.XMLParser.<init>(XMLParser.java:70)
    at com.iplanet.portalserver.naming.share.NamingResponseParser.<init>(NamingResponseParser.java:33)
    at com.iplanet.portalserver.naming.share.NamingResponse.parseXML(NamingResponse.java:74)
    at com.iplanet.portalserver.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:174)
    at com.iplanet.portalserver.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:155)
    at com.iplanet.portalserver.naming.WebtopNaming.getServiceURL(WebtopNaming.java:57)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:534)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:520)
    at com.iplanet.portalserver.session.Session.getSession(Session.java:414)
    at jsp_servlet.__eatonPortalLogin._jspService(__eatonPortalLogin.java:155)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:462)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
    <May 19, 2004 9:01:12 AM EDT> <Error> <HTTP> <101017> <[ServletContext(id=4873279,name=ematrix,context-path=/ematrix)] Root cause of ServletException
    com.iplanet.portalserver.session.SessionException
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:539)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:520)
    at com.iplanet.portalserver.session.Session.getSession(Session.java:414)
    at jsp_servlet.__eatonPortalLogin._jspService(__eatonPortalLogin.java:155)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:462)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
    Any help/pointers will be appreciated.
    Ashish

    Just for anyone else who hits this problem: I encountered the same issue with an XML document that XMLSpy claims is quite well formed. I opened the document in a hex editor, and there at the from was a three-byte byte order marker - the marker that I believe the UTF-8 standard says is optional. I removed these three bytes, and the file was parsed correctly.
    In this case, the XML file was created using a Microsft DOM (save).
    My solution is to make the java parser - as I use it - a tad more robust: Open the file and create an input stream - a pushback input stream. Read the first three bytes; if they are NOT a BOM, then push those bytes back. Now - in any case - give the stream to the parser to read.
    try {
    // Open file for reading.
    f = new File(path);
    FileInputStream fis = new FileInputStream(f);
    PushbackInputStream pis = new PushbackInputStream(fis);
    byte[] buf = new byte[3];
    pis.read(buf, 0, 3);
    if (! (buf[0] == 0x00EF) && (buf[1] == 0x00BB) && (buf[2] == 0x00BF) ) {
         pis.unread(buf, 0, 3);
    builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    doc = builder.parse(pis);
    catch (Exception x) {
         x.printStackTrace();
    }

  • Problem in parsing a particular XML file.

    Hello, I have an XML file like this:
    <eGov_IT:Intestazione xmlns:eGov_IT="http://www.cnipa.it/schemas/2003/eGovIT/Busta1_0/" xmlns:SOAP_ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cnipa.it/schemas/2003/eGovIT/Busta1_0/
    E:\Progetti\EchoPorte\sviluppo\WEBCON~1\WEB-INF\risorse\Messaggio.xsd">
    <eGov_IT:IntestazioneMessaggio xmlns:eGov_IT="http://www.cnipa.it/schemas/2003/eGovIT/Busta1_0/">
    <eGov_IT:Collaborazione>PortaDelegata_PortaDiDominio_0000001_2007-10-05_12:26</eGov_IT:Collaborazione>
    <eGov_IT:Identificatore>PortaDelegata_PortaDiDominio_0000002_2007-10-05_12:26</eGov_IT:Identificatore>
    </eGov_IT:IntestazioneMessaggio>
    As you can see there are 2 elements in which the values are really similar. In fact in the Schema we use they have to match the same regular expression; here's the extract from my schema.
    <xsd:element name="Collaborazione" type="IdentificatoreType"/>
    <xsd:element name="Identificatore" type="IdentificatoreType"/>
    <xsd:simpleType name="IdentificatoreType">
    <xsd:restriction base="xsd:string">
    <xsd:pattern value="[\w]+_[\w]+_\d{7}_\d{4}\-\d{2}\-\d{2}_\d{2}:\d{2}"/>
    </xsd:restriction>
    </xsd:simpleType>
    I can CORRECTLY validate this expression using this code:
    public void validate (String doc, String schema) throws SAXParseException, SAXException
    try
    SchemaFactory schemaFactory = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI );
    Schema schemaXSD = schemaFactory.newSchema( new File ( schema ) );
    Validator validator = schemaXSD.newValidator();
    DocumentBuilderFactory.newInstance().newDocumentBuilder();
    ByteArrayInputStream baisDoc = new ByteArrayInputStream(doc.getBytes());
    Document document = parser.parse(baisDoc);
    validator.validate( new DOMSource( document ) );
    And, in case the validation fails, I correctly gain a SAXParseException.
    The problem is that I can't understand if, in this case, the error is in the "Collaborazione" element or in the "Identificatore" element, because I get the following detailed message from the Exception:
    "cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[\w]+_[\w]+_\d{7}_\d{4}\-\d{2}\-\d{2}_\d{2}:\d{2}' for type 'IdentificatoreType'."
    How can I get more detailed informations about this error?
    Thanks everybody,
    Cris

    Check here:
    http://forum.java.sun.com/thread.jspa?threadID=5223284
    This is the correct post with my problem.
    Thanks!
    Cristiano

  • How to remove empty lines from xml files after removing nodes from document

    <pre>
    Hi
    <b>i have xml document, which is shown below
    after removing some nodes from the document ,i am getting empty lines in place of removed nodes,how to resolve this and get the proper xml document without any errors</b>
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE Message SYSTEM "TRD01.dtd">
    <Message>
    <Header>
    <CounterPartyType>CLIENT</CounterPartyType>
    <CreationTime>20134455</CreationTime>
    <ErrorCode>363 </ErrorCode>
    <ErrorEnterPriseId>N</ErrorEnterPriseId>
    <ErrorStatus>1</ErrorStatus>
    <ErrorSystemId>STL</ErrorSystemId>
    <ErrorTimes>31</ErrorTimes>
    <MessageType>T</MessageType>
    <RecipientEnterpriseId>N</RecipientEnterpriseId>
    <RecipentSystemId>EXM</RecipentSystemId>
    <Remarks>REMARSK</Remarks>
    <SenderEnterpriseId>N</SenderEnterpriseId>
    <SenderSystemId>TR</SenderSystemId>
    </Header>
    </Message>
    <ErrorCode>363 </ErrorCode>
    <ErrorEnterPriseId>NIHK</ErrorEnterPriseId>
    <ErrorStatus>1</ErrorStatus>
    <ErrorSystemId>STL</ErrorSystemId>
    <ErrorTimes>31</ErrorTimes>
    XPathExpression expression5 = xpath.compile(xmlpath5);
    Object result5 = expression5.evaluate(doc, XPathConstants.NODE);
    Node node5 = (Node) result5;
    node5.getParentNode().removeChild(node5);
    XPathExpression expression6 = xpath.compile(xmlpath6);
    Object result6 = expression6.evaluate(doc, XPathConstants.NODE);
    Node node6=(Node) result6;
    node6.getParentNode().removeChild(node6);
    XPathExpression expression7 = xpath.compile(xmlpath7);
    Object result7 = expression7.evaluate(doc, XPathConstants.NODE);
    Node node7=(Node) result7;
    node7.getParentNode().removeChild(node7);
    doc.normalize();
    doc.normalizeDocument();
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.setOutputProperty(OutputKeys.INDENT, "yes");
    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
    t.setOutputProperty(OutputKeys.METHOD,"xml");
    t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    the xml output i am getting is
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Message>
    <Header>
    <CounterPartyType>CLIENT</CounterPartyType>
    <CreationTime>20134455</CreationTime>
    <MessageType>TRD01</MessageType>
    <RecipientEnterpriseId>N</RecipientEnterpriseId>
    <RecipentSystemId>STL</RecipentSystemId>
    <Remarks>REMARSK</Remarks>
    <SenderEnterpriseId>N</SenderEnterpriseId>
    <SenderSystemId>T</SenderSystemId>
    </Header>
    </Message>
    <b>could you please let me know how to avoid empty lines in the xml doucment output</b>
    this is the method i am using to get the result
    public void ValidateRecord(String xml){
    try{
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = factory.newDocumentBuilder();
    //parse file into DOM
    /*DOMParser parser = new DOMParser();
    parser.setErrorStream(System.err);
    parser.setValidationMode(DTD_validation);
    parser.showWarnings(true);*/
    System.out.println ("HI THIS xml is validation "+xml);
    Resolver res = new Resolver();
    db.setEntityResolver(res);
    Document doc = db.parse(new InputSource(new StringReader(xml)));
    XPathFactory xpf = XPathFactory.newInstance();
    XPath xpath = xpf.newXPath();
    // XPathExpression expression = xpath.compile("//A/B[C/E/text()=13]");
    String xmlpath="/Message/Header/CounterPartyType/text()";
    String xmlpath1="/Message/Header/RecipentSystemId/text()";
    String xmlpath2="/Message/Header/ErrorSystemId/text()";
    XPathExpression expression = xpath.compile(xmlpath);
    XPathExpression expression1 = xpath.compile(xmlpath2);
    Object result = expression.evaluate(doc, XPathConstants.NODE);
    Object result1 = expression1.evaluate(doc, XPathConstants.NODE);
    Node node = (Node) result;
    Node node1 = (Node) result1;
    System.out.println("the values of the string is " +node.getNodeValue());
    System.out.println("the values of the string is " +node1.getNodeValue());
    // for (int i = 0; i < nodes.getLength(); i++) {
    //System.out.println(nodes.item(i).getNodeValue());
    // CAHNGING THE RECEIPENT NODE
    XPathExpression expression2 = xpath.compile(xmlpath1);
    Object result2 = expression2.evaluate(doc, XPathConstants.NODE);
    Node node2 = (Node) result2;
    System.out.println(node2);
    node2.setNodeValue(node1.getNodeValue());
    System.out.println(node2);
    //removing the nodes from document
    String xmlpath3="/Message/Header/ErrorCode";
    String xmlpath4="/Message/Header/ErrorEnterPriseId";
    String xmlpath5="/Message/Header/ErrorStatus";
    String xmlpath6="/Message/Header/ErrorSystemId";
    String xmlpath7="/Message/Header/ErrorTimes";
    XPathExpression expression3 = xpath.compile(xmlpath3);
    Object result3 = expression3.evaluate(doc, XPathConstants.NODE);
    Node node3 = (Node) result3;
    node3.getParentNode().removeChild(node3);
    XPathExpression expression4 = xpath.compile(xmlpath4);
    Object result4 = expression4.evaluate(doc, XPathConstants.NODE);
    Node node4 = (Node) result4;
    System.out.println("node value");
    System.out.println(node4.getParentNode().getNodeName());
    node4.getParentNode().removeChild(node4);
    XPathExpression expression5 = xpath.compile(xmlpath5);
    Object result5 = expression5.evaluate(doc, XPathConstants.NODE);
    Node node5 = (Node) result5;
    node5.getParentNode().removeChild(node5);
    XPathExpression expression6 = xpath.compile(xmlpath6);
    Object result6 = expression6.evaluate(doc, XPathConstants.NODE);
    Node node6=(Node) result6;
    node6.getParentNode().removeChild(node6);
    XPathExpression expression7 = xpath.compile(xmlpath7);
    Object result7 = expression7.evaluate(doc, XPathConstants.NODE);
    Node node7=(Node) result7;
    node7.getParentNode().removeChild(node7);
    // Node b13Node = (Node) expression.evaluate(doc, XPathConstants.NODE);
    //b13Node.getParentNode().removeChild(b13Node);
    doc.normalize();
    doc.normalizeDocument();
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.setOutputProperty(OutputKeys.INDENT, "yes");
    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
    t.setOutputProperty(OutputKeys.METHOD,"xml");
    t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    t.transform(new DOMSource(doc), new StreamResult(System.out));
    catch (Exception e) {
         e.printStackTrace();
    System.out.println(e.getMessage());
    </pre>
    Edited by: user12185243 on Apr 6, 2013 6:38 AM
    Edited by: user12185243 on Apr 6, 2013 6:41 AM
    Edited by: user12185243 on Apr 6, 2013 6:43 AM
    Edited by: user12185243 on Apr 6, 2013 6:45 AM
    Edited by: user12185243 on Apr 6, 2013 9:00 AM

    either this way we can do this
    1)
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    <b> factory.setIgnoringElementContentWhitespace(true); </b>
    DocumentBuilder db = factory.newDocumentBuilder();
    or
    2)
    java.io.StringWriter sw = new java.io.StringWriter();
    StreamResult sr = new StreamResult(sw);
    t.transform(new DOMSource(doc), sr);
    String xml1 = sw.toString().trim();
    <b> xml1=xml1.replaceAll("\\s",""); </b>
    System.out.println(xml1.trim());

  • JSTL - Problem parsing XML file w/ XML schema declarations

    I'm having trouble parsing an xml document that contains XML schema declarations in the root element. I've included 2 snippets, the XML files they're supposed to parse, and their output below. The first one works and the second one doesn't. Could someone please tell me why? I find it hard to believe that no one's run into this before.
    I'm running Tomcat 5.5 and I'm using JSP 2.0, jakarta standard taglibs jars (1.1.2), jdk 1.5.0_04, and the Xalan 2.7.0 jars.
    Here's the first snippet:
    <c:import url="/WEB-INF/config/schools.xml" var="xml" />
    <x:parse doc="${xml}" var="schoolList"/>
    There are <x:out select="count($schoolList//school)"/> schools in the file:<br/>
    <x:forEach select="$schoolList//school">
         <x:out select="name"/><br/>
    </x:forEach>it parses the following xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <schools>
         <school id="34033">
              <name>Tumwater Middle School</name>
              <district>Tumwater</district>
              <type>middle</type>
              <active>false</active>
         </school>
         <school id="17001">
              <name>Garfield High School</name>
              <district>Seattle</district>
              <type>high</type>
              <active>true</active>
         </school>
         <school id="00023">
              <name>Tigard High School</name>
              <district>Tigard-Tualatin</district>
              <type>high</type>
              <active>true</active>
         </school>
    </schools>and it outputs:
    There are 3 schools in the file:
    Tumwater Middle School
    Garfield High School
    Tigard High School-----------------------------------------
    The second snippet:
    <c:import url="/WEB-INF/config/schools2.xml" var="xml2" />
    <x:parse doc="${xml2}" var="schoolList2"/>
    There are <x:out select="count($schoolList2//school)"/> schools in the file:<br/>
    <x:forEach select="$schoolList2//school">
         <x:out select="name"/><br/>
    </x:forEach>parses this xml file (note the xml schema declarations):
    <?xml version="1.0" encoding="UTF-8"?>
    <schools xmlns="http://www.serenus.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.serenus.com schools.xsd">
         <school id="34033">
              <name>Tumwater Middle School</name>
              <district>Tumwater</district>
              <type>middle</type>
              <active>false</active>
         </school>
         <school id="17001">
              <name>Garfield High School</name>
              <district>Seattle</district>
              <type>high</type>
              <active>true</active>
         </school>
         <school id="00023">
              <name>Tigard High School</name>
              <district>Tigard-Tualatin</district>
              <type>high</type>
              <active>true</active>
         </school>
    </schools>and its output is:
    There are 0 schools in the file:That's it! No errors at all! I'm 100% certain the variable names, filenames, etc. are correct. I've looked everywhere for an existing answer to this problem, but I can't find one. Is this a known issue? Please help.
    -Ben

    Hi Ben,
    I got exactly the same problem and also could not find any solution.
    Did you find a way out for this problem meanwhile?
    Any help is welcome!

  • I want to create a parser file which dynamically reads out XML file.

    HI ,.
    I created a DOM parser where i am getting the values of XML file by tag names...
    which is increasing my code lines number ...
    So can any one suggest me with proper way of approach to overcome this....

    HI ...
    Here is the code...
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.PrintStream;
    import java.lang.Integer;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import sun.java2d.loops.FillPath;
    import sun.nio.ch.FileKey;
    public class XMLFileParser{
         int Size,Height,X,Y,W,H;
         String L;
         String Path;
         boolean resize;
         XMLFileParser(){
    void Parser(){
         try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                Document doc = docBuilder.parse (new File("book.xml"));
                // normalize text representation
                doc.getDocumentElement ().normalize ();
                System.out.println ("Root element of the doc is " +
                     doc.getDocumentElement().getNodeName());
           //first node.
                                        NodeList FrameValues = doc.getElementsByTagName("Frame");
                                        NodeList children=(NodeList)doc.getDocumentElement().getChildNodes();
                                        System.out.println("total of childs are: "+children.getLength());
                                        //for (int j = 0; j < children.getLength(); j++)
                                        //     System.out.println(" the childs are: "+children.item(j));
                                             for(int s=0; s<FrameValues.getLength() ; s++){
                                                  // System.out.println(FrameValues.getLength());
                                 Node FirstFileNode = FrameValues.item(s);
                                 if(FirstFileNode.getNodeType() == Node.ELEMENT_NODE){
                                 Element frameelements = (Element)FirstFileNode;
                                 NodeList FrameValueList1 = frameelements.getElementsByTagName("setSize");
                                 Element firstAttributeElement = (Element)FrameValueList1.item(0);
                                    NodeList List1 = firstAttributeElement.getChildNodes();
                                 Node node1 = (Node)List1.item(0);
                                 String nodeName1 = node1.getNodeValue();
                                 int value1 = Integer.parseInt(nodeName1);                           
                                 setSize(value1);
                                 NodeList FrameValueList2 = frameelements.getElementsByTagName("Height");
                                 Element secondAttributeElement = (Element)FrameValueList2.item(0);
                                 NodeList List2 = secondAttributeElement.getChildNodes();
                                 Node node2 = (Node)List2.item(0);
                                 String nodeName2 = node2.getNodeValue();
                                 int value2 = Integer.parseInt(nodeName2);
                                   setHeight(value2);
                                 NodeList FrameValueList3 = frameelements.getElementsByTagName("BoundsX");
                                 Element thirdAttributeElement = (Element)FrameValueList3.item(0);
                                 NodeList List3 = thirdAttributeElement.getChildNodes();
                                 Node node3 = (Node)List3.item(0);
                                 String nodeName3 = node3.getNodeValue();
                                 int value3 = Integer.parseInt(nodeName3);
                                   setBounds(value3);
                                    NodeList FrameValueList4 = frameelements.getElementsByTagName("BoundsY");
                                    Element fourthAttributeElement = (Element)FrameValueList4.item(0);
                                    NodeList List4 = fourthAttributeElement.getChildNodes();
                                    Node node4 = (Node)List4.item(0);
                                    String nodeName4= node4.getNodeValue();
                                    int value4 = Integer.parseInt(nodeName4);
                                  setBounds1(value4);
                                  NodeList FrameValueList5 = frameelements.getElementsByTagName("BoundsW");
                                    Element fifthAttributeElement = (Element)FrameValueList5.item(0);
                                    NodeList List5 = fourthAttributeElement.getChildNodes();
                                    Node node5 = (Node)List5.item(0);
                                    String nodeName5 = node5.getNodeValue();
                                    int value5 = Integer.parseInt(nodeName5);
                                  setBounds2(value5);
                                  NodeList FrameValueList6 = frameelements.getElementsByTagName("BoundsH");
                                    Element sixthAttributeElement = (Element)FrameValueList6.item(0);
                                    NodeList List6 = sixthAttributeElement.getChildNodes();
                                    Node node6 = (Node)List6.item(0);
                                    String nodeName6 = node6.getNodeValue();
                                    int value6 = Integer.parseInt(nodeName6);
                                  setBounds3(value6);
                                  NodeList FrameValueList7 = frameelements.getElementsByTagName("Resize");
                                    Element seventhAttributeElement = (Element)FrameValueList6.item(0);
                                    NodeList List7 = seventhAttributeElement.getChildNodes();
                                    Node node7 = (Node)List7.item(0);
                                    String nodeName7 = node7.getNodeValue();
                                    boolean value7= Boolean.parseBoolean(nodeName7);
                                  setResize(value7);
         // second node.
                                        NodeList PanelValues = doc.getElementsByTagName("Panel");
                                        for(int s=0; s<PanelValues.getLength() ; s++){
                          // System.out.println(FrameValues.getLength());
                                 Node FirstFileNode = PanelValues.item(s);
                                 if(FirstFileNode.getNodeType() == Node.ELEMENT_NODE){
                                 Element Panelelements = (Element)FirstFileNode;
                                 NodeList PanelValueList1 = Panelelements.getElementsByTagName("Layout");
                                 Element firstAttributeElement = (Element)PanelValueList1.item(0);
                                    NodeList List1 = firstAttributeElement.getChildNodes();
                                 Node node1 = (Node)List1.item(0);
                                 String Layout = node1.getNodeValue();
                                 //int value1 = Integer.parseInt(nodeName1);                           
                                 setLayout(Layout);
                                 NodeList PanelValueList2 = Panelelements.getElementsByTagName("ImagePath");
                                 Element secondAttributeElement = (Element)PanelValueList2.item(0);
                                    NodeList List2 = secondAttributeElement.getChildNodes();
                                 Node node2 = (Node)List1.item(0);
                                 String path = node1.getNodeValue();
                                 //int value1 = Integer.parseInt(nodeName1);                           
                                 setPath(path);
                    }//end of if clause
                }//end of for loop with s1 var*/
            catch (SAXParseException err)
            System.out.println ("** Parsing error" + ", line "
                 + err.getLineNumber () + ", uri " + err.getSystemId ());
            System.out.println(" " + err.getMessage ());
            catch (SAXException e)
            Exception x = e.getException ();
            ((x == null) ? e : x).printStackTrace ();
            catch (Throwable t)
            t.printStackTrace ();
    private void setResize(boolean value7) {
         // TODO Auto-generated method stub
         resize=value7;
    public boolean getResize(){
         System.out.println("Resize" + resize);
         return resize;
    private void setPath(String path) {
         // TODO Auto-generated method stub
          Path = path;
    public String getPath(){
         System.out.println("Path" + Path);
         return Path;
    private void setLayout(String layout) {
         // TODO Auto-generated method stub
         L=layout;
    public String getLayout(){
         System.out.println("Layout" + L);
         return L;
    private void setBounds3(int value6) {
         // TODO Auto-generated method stub
         H=value6;
         System.out.println("setBoundsH" + H);
    public int getBounds3(){
         System.out.println("getBoundsH" + H);
         return H;
    private void setBounds2(int value5) {
         // TODO Auto-generated method stub
         W=value5;
         System.out.println("setBoundsW" + W);
    public int getBounds2(){
         System.out.println("getBoundsW" + W);
         return W;
    private void setBounds1(int value4) {
         // TODO Auto-generated method stub
         Y=value4;
         System.out.println("setBoundsY" + Y);
    public int getBounds1(){
         System.out.println("getBoundsY" + Y);
         return Y;
    public void setBounds(int value3) {
         // TODO Auto-generated method stub
    X= value3;
         System.out.println("setBoundsX" + X);
    public int getBounds(){
         System.out.println("getBoundsX" + X);
         return X ;
    public void setHeight(int value2) {
              // TODO Auto-generated method stub
              Height=value2;
              System.out.println("setHeight " + Height);
    public int getHeight(){
         System.out.println("getHeight " + Height);
         return (Height);
    setSize(int value1) {
              // TODO Auto-generated method stub
              Size=value1;
              System.out.println("setSize " + Size);
         public int getSize() {
              System.out.println("getSize " + Size);
              return ( Size);
          }here i am calling the elements of my xml file each time by tag name ...which is increasing my code lines....so any solution please....

  • Error while parsing or executing XML-SQL document

    friends,
    my scenario is based on file to jdbc.i am facing  an error in receiver CC in RWB.
    The error states that '
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'MATMAS' (structure 'STATEMENT'): java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]String or binary data would be truncated.'
    My SOAP xml message is
    - <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    - <SOAP:Header>
    - <sap:Main xmlns:sap="http://sap.com/xi/XI/Message/30" versionMajor="3" versionMinor="0" SOAP:mustUnderstand="1" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="wsuid-main-92ABE13F5C59AB7FE10000000A1551F7">
      <sap:MessageClass>ApplicationMessage</sap:MessageClass>
      <sap:ProcessingMode>asynchronous</sap:ProcessingMode>
      <sap:MessageId>18f17dd0-d503-11dc-cb4d-001635b02bfd</sap:MessageId>
      <sap:TimeSent>2008-02-06T22:30:21Z</sap:TimeSent>
    - <sap:Sender>
      <sap:Party agency="http://sap.com/xi/XI" scheme="XIParty" />
      <sap:Service>ECC</sap:Service>
      </sap:Sender>
    - <sap:Receiver>
      <sap:Party agency="http://sap.com/xi/XI" scheme="XIParty" />
      <sap:Service>BS_JDBC</sap:Service>
      </sap:Receiver>
      <sap:Interface namespace="http://file_to_jdbc">MI_JDBC_RECEIVER</sap:Interface>
      </sap:Main>
    - <sap:ReliableMessaging xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
      <sap:QualityOfService>ExactlyOnce</sap:QualityOfService>
      </sap:ReliableMessaging>
    - <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
      <sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">
    sapecc50\sapmnt\trans</sap:Record>
      <sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileEncoding">UTF-8</sap:Record>
      <sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">txt</sap:Record>
      <sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">matmas1.txt</sap:Record>
      </sap:DynamicConfiguration>
    - <sap:HopList xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
    - <sap:Hop timeStamp="2008-02-06T22:30:21Z" wasRead="false">
      <sap:Engine type="AE">af.e6e.sapecc6eval</sap:Engine>
      <sap:Adapter namespace="http://sap.com/xi/XI/System">XIRA</sap:Adapter>
      <sap:MessageId>18f17dd0-d503-11dc-cb4d-001635b02bfd</sap:MessageId>
      <sap:Info />
      </sap:Hop>
    - <sap:Hop timeStamp="2008-02-06T22:30:21Z" wasRead="false">
      <sap:Engine type="IS">is.01.sapecc6eval</sap:Engine>
      <sap:Adapter namespace="http://sap.com/xi/XI/System">XI</sap:Adapter>
      <sap:MessageId>18f17dd0-d503-11dc-cb4d-001635b02bfd</sap:MessageId>
      <sap:Info>3.0</sap:Info>
      </sap:Hop>
    - <sap:Hop timeStamp="2008-02-06T22:30:22Z" wasRead="false">
      <sap:Engine type="AE">af.e6e.sapecc6eval</sap:Engine>
      <sap:Adapter namespace="http://sap.com/xi/XI/System">XIRA</sap:Adapter>
      <sap:MessageId>18f17dd0-d503-11dc-cb4d-001635b02bfd</sap:MessageId>
      </sap:Hop>
      </sap:HopList>
    - <sap:Diagnostic xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
      <sap:TraceLevel>Information</sap:TraceLevel>
      <sap:Logging>Off</sap:Logging>
      </sap:Diagnostic>
      </SOAP:Header>
    - <SOAP:Body>
    - <sap:Manifest xmlns:sap="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="wsuid-manifest-5CABE13F5C59AB7FE10000000A1551F7">
    - <sap:Payload xlink:type="simple" xlink:href="cid:[email protected]">
      <sap:Name>MainDocument</sap:Name>
      <sap:Description />
      <sap:Type>Application</sap:Type>
      </sap:Payload>
      </sap:Manifest>
      </SOAP:Body>
      </SOAP:Envelope>
    and payload message is
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_JDBC_RECEIVER xmlns:ns0="http://file_to_jdbc">
    - <STATEMENT>
    - <ROW action="INSERT">
      <TABLE>MATMAS</TABLE>
    - <access>
      <MATNR>38</MATNR>
      <MTART>HALB</MTART>
      <MATKL>00107</MATKL>
      <MEINS>pc</MEINS>
      <ERSDA>2008.04.05</ERSDA>
      <BRGEW>10</BRGEW>
      <NTGEW>12</NTGEW>
      <GEWEI>KG</GEWEI>
      </access>
    - <access>
      <MATNR>88</MATNR>
      <MTART>FERT</MTART>
      <MATKL>02004</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2008.04.05</ERSDA>
      <BRGEW>12</BRGEW>
      <NTGEW>13</NTGEW>
      <GEWEI>KG</GEWEI>
      </access>
    - <access>
      <MATNR>89</MATNR>
      <MTART>FERT</MTART>
      <MATKL>02004</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2008.03.02</ERSDA>
      <BRGEW>12</BRGEW>
      <NTGEW>14</NTGEW>
      <GEWEI>KG</GEWEI>
      </access>
    - <access>
      <MATNR>98</MATNR>
      <MTART>HALB</MTART>
      <MATKL>2</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2006.09.01</ERSDA>
      <BRGEW>12</BRGEW>
      <NTGEW>12</NTGEW>
      <GEWEI>KG</GEWEI>
      </access>
    - <access>
      <MATNR>170</MATNR>
      <MTART>NLAG</MTART>
      <MATKL>4</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2005.03.02</ERSDA>
      <BRGEW>2</BRGEW>
      <NTGEW>3</NTGEW>
      <GEWEI>KG</GEWEI>
      </access>
    - <access>
      <MATNR>178</MATNR>
      <MTART>NLAG</MTART>
      <MATKL>4</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2007.03.06</ERSDA>
      <BRGEW>3</BRGEW>
      <NTGEW>4</NTGEW>
      <GEWEI>KG</GEWEI>
      </access>
    - <access>
      <MATNR>188</MATNR>
      <MTART>NLAG</MTART>
      <MATKL>5</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2007.05.02</ERSDA>
      <BRGEW>2</BRGEW>
      <NTGEW>3</NTGEW>
      <GEWEI>KG</GEWEI>
      </access>
    - <access>
      <MATNR>288</MATNR>
      <MTART>HALB</MTART>
      <MATKL>101</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2006.02.11</ERSDA>
      <BRGEW>5</BRGEW>
      <NTGEW>4</NTGEW>
      <GEWEI>KG</GEWEI>
      </access>
    - <access>
      <MATNR>358</MATNR>
      <MTART>HAWA</MTART>
      <MATKL>2</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2007.09.09</ERSDA>
      <BRGEW>500</BRGEW>
      <NTGEW>500</NTGEW>
      <GEWEI>G</GEWEI>
      </access>
    - <access>
      <MATNR>359</MATNR>
      <MTART>HAWA</MTART>
      <MATKL>2</MATKL>
      <MEINS>PC</MEINS>
      <ERSDA>2007.08.01</ERSDA>
      <BRGEW>20</BRGEW>
      <NTGEW>10</NTGEW>
      <GEWEI>G</GEWEI>
      </access>
      </ROW>
      </STATEMENT>
      </ns0:MT_JDBC_RECEIVER>
    Could anybody help me in sorting out this issue.My advance thanks

    hi,
    ypur structure is bad defined.
    if you want to do an insert, the DT should be
    <ns0:MT_JDBC_RECEIVER xmlns:ns0="http://file_to_jdbc">
    ___<StatementName>
    ______<dbTableName action=”INSERT”>
    _____<table>MATMAS</table>
    _______ <access>
    ___________<MATNR>38</MATNR>
    ___________<MTART>HALB</MTART>
    ___________<MATKL>00107</MATKL>
    ___________<MEINS>pc</MEINS>
    ___________<ERSDA>2008.04.05</ERSDA>
    ___________<BRGEW>10</BRGEW>
    ___________<NTGEW>12</NTGEW>
    ___________<GEWEI>KG</GEWEI>
    ______</access>
    _____</dbTableName>
    __ </StatementName>
    </ns0:MT_JDBC_RECEIVER>
    the ROW field is used when you wait receive data from DB for example you execute and SQL Query from Sender communication channel "SELECT name FROM TABLE Names"
    so, the result of this query would be, for example:
    <row>
    ____<name>joge</name>
    </row>
    <row>
    ____<name>pepe</name>
    </row>
    <row>
    ____<name>nicola</name>
    </row>
    See this link
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
    Thanks
    Rodrigo
    Edited by: Rodrigo Pertierra on Feb 8, 2008 8:40 AM
    Edited by: Rodrigo Pertierra on Feb 8, 2008 8:42 AM

  • Error while parsing or executing XML-SQL document attribute "action" missin

    Hi All,
          I am doing a scenario for IDOC to JDBC, When I push IDOC from R/3 , IDOC sent to XI System successfully, 
           I have also checked in SXMB_MONI it is showing the successful staus without any errors, and I have also copied the xml structure from main document of payloads and tested the mapping in Integration Designer, and it is showing successfull message.
    here is the xml structure from  payloads of Request Message Mapping ........
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:RTACOGRP_RECEIVER_MT xmlns:ns0="http://prospecta.com/wsorta/cosmas/idoc2jdbc">
    - <COGRP_TMP_PROC action="EXECUTE">
      <IDOCNUMBER isInput="TRUE" type="CHAR">1000001</IDOCNUMBER>
      <E1COGH_NUMBER isInput="TRUE" type="CHAR">1</E1COGH_NUMBER>
      <E1COGH_HIGHERSEGMENT isInput="TRUE" type="CHAR">1</E1COGH_HIGHERSEGMENT>
      <E1COGH_MSGFN isInput="TRUE" type="CHAR">1</E1COGH_MSGFN>
      <E1COGH_GROUPTYPE isInput="TRUE" type="CHAR">1</E1COGH_GROUPTYPE>
      <E1COGH_GROUPNAME isInput="TRUE" type="CHAR">1</E1COGH_GROUPNAME>
      <E1COGH_KOKRS isInput="TRUE" type="CHAR">1</E1COGH_KOKRS>
      <E1COGHT_NUMBER isInput="TRUE" type="CHAR">1</E1COGHT_NUMBER>
      <E1COGHT_HIGHERSEGMENT isInput="TRUE" type="CHAR">2</E1COGHT_HIGHERSEGMENT>
      <E1COGHT_LANGU isInput="TRUE" type="CHAR">2</E1COGHT_LANGU>
      <E1COGHT_DESCRIPT isInput="TRUE" type="CHAR">2</E1COGHT_DESCRIPT>
      <E1COGHT_LANGU_ISO isInput="TRUE" type="CHAR">2</E1COGHT_LANGU_ISO>
      <E1COGV_NUMBER isInput="TRUE" type="CHAR">1</E1COGV_NUMBER>
      <E1COGV_HIGHERSEGMENT isInput="TRUE" type="CHAR">3</E1COGV_HIGHERSEGMENT>
      <E1COGV_FROMVALUE isInput="TRUE" type="CHAR">6</E1COGV_FROMVALUE>
      <E1COGV_TOVALUE isInput="TRUE" type="CHAR">6</E1COGV_TOVALUE>
      <E1COGS_NUMBER isInput="TRUE" type="CHAR">1</E1COGS_NUMBER>
      <E1COGS_HIGHERSEGMENT isInput="TRUE" type="CHAR">5</E1COGS_HIGHERSEGMENT>
      <E1COGS_SUBGROUP isInput="TRUE" type="CHAR">4</E1COGS_SUBGROUP>
      <E1COGHR_NUMBER isInput="TRUE" type="CHAR">1</E1COGHR_NUMBER>
      <E1COGHR_HIGHERSEGMENT isInput="TRUE" type="CHAR">6</E1COGHR_HIGHERSEGMENT>
      <E1COGHR_SNAME isInput="TRUE" type="CHAR">3</E1COGHR_SNAME>
      <E1COGHR_PRTCLASS isInput="TRUE" type="CHAR">3</E1COGHR_PRTCLASS>
      <E1COGHR_AUTHGR isInput="TRUE" type="CHAR">3</E1COGHR_AUTHGR>
      <E1COGSR_NUMBER isInput="TRUE" type="CHAR">1</E1COGSR_NUMBER>
      <E1COGSR_HIGHERSEGMENT isInput="TRUE" type="CHAR">7</E1COGSR_HIGHERSEGMENT>
      <E1COGSR_XSUPPRESS isInput="TRUE" type="CHAR">5</E1COGSR_XSUPPRESS>
      <E1COGSR_PRTCLASS isInput="TRUE" type="CHAR">5</E1COGSR_PRTCLASS>
      <E1COGSR_LNAME isInput="TRUE" type="CHAR">5</E1COGSR_LNAME>
      <E1COGVT_NUMBER isInput="TRUE" type="CHAR">1</E1COGVT_NUMBER>
      <E1COGVT_HIGHERSEGMENT isInput="TRUE" type="CHAR">9</E1COGVT_HIGHERSEGMENT>
      <E1COGVT_LANGU isInput="TRUE" type="CHAR">7</E1COGVT_LANGU>
      <E1COGVT_DESCRIPT isInput="TRUE" type="CHAR">7</E1COGVT_DESCRIPT>
      <E1COGVT_LANGU_ISO isInput="TRUE" type="CHAR">7</E1COGVT_LANGU_ISO>
      <E1COGVR_NUMBER isInput="TRUE" type="CHAR">1</E1COGVR_NUMBER>
      <E1COGVR_HIGHERSEGMENT isInput="TRUE" type="CHAR">12</E1COGVR_HIGHERSEGMENT>
      <E1COGVR_XSUPPRESS isInput="TRUE" type="CHAR">8</E1COGVR_XSUPPRESS>
      <E1COGVR_PRTCLASS isInput="TRUE" type="CHAR">8</E1COGVR_PRTCLASS>
      <E1COGVR_LNAME isInput="TRUE" type="CHAR">8</E1COGVR_LNAME>
      </COGRP_TMP_PROC>
      </ns0:RTACOGRP_RECEIVER_MT>
    When I checked for component monitoring in runtime workbench....
    these are the messages........
    <i>Error while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)</i>
    Here are the messages from message monitoring ......
    2007-06-07 12:42:17 Success Receiver JDBC adapter: processing started; QoS required: ExactlyOnce
    2007-06-07 12:42:17 Success JDBC adapter receiver channel RTACOGRP_COM_Chan: processing started; party  , service WSORTABS
    2007-06-07 12:42:17 Error No "action" attribute found in XML document ("action" attribute missing or wrong XML structure)
    2007-06-07 12:42:17 Error MP: exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)
    2007-06-07 12:42:17 Error Exception caught by adapter framework: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)
    2007-06-07 12:42:17 Error Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure).
    2007-06-07 12:42:17 Error The message status set to NDLV.
    Can any body please resolve the problem.....
    Thanks in Advance
    Murthy

    Bhavesh,
    Now I have changed the data structure , and the resultant structure is like this...
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:RTACOGRP_RECEIVER_MT xmlns:ns0="http://prospecta.com/wsorta/cosmas/idoc2jdbc">
    - <Statement>
    - <COGRP_TMP_PROC action="EXECUTE">
      <IDOCNUMBER isInput="TRUE" type="CHAR">100002223</IDOCNUMBER>
      <E1COGH_NUMBER isInput="TRUE" type="CHAR">1</E1COGH_NUMBER>
      <E1COGH_HIGHERSEGMENT isInput="TRUE" type="CHAR">1</E1COGH_HIGHERSEGMENT>
      <E1COGH_MSGFN isInput="TRUE" type="CHAR">H</E1COGH_MSGFN>
      <E1COGH_GROUPTYPE isInput="TRUE" type="CHAR">H</E1COGH_GROUPTYPE>
      <E1COGH_GROUPNAME isInput="TRUE" type="CHAR">H</E1COGH_GROUPNAME>
      <E1COGH_KOKRS isInput="TRUE" type="CHAR">H</E1COGH_KOKRS>
      <E1COGHT_NUMBER isInput="TRUE" type="CHAR">1</E1COGHT_NUMBER>
      <E1COGHT_HIGHERSEGMENT isInput="TRUE" type="CHAR">2</E1COGHT_HIGHERSEGMENT>
      <E1COGHT_LANGU isInput="TRUE" type="CHAR">T</E1COGHT_LANGU>
      <E1COGHT_DESCRIPT isInput="TRUE" type="CHAR">T</E1COGHT_DESCRIPT>
      <E1COGHT_LANGU_ISO isInput="TRUE" type="CHAR">T</E1COGHT_LANGU_ISO>
      <E1COGV_NUMBER isInput="TRUE" type="CHAR">1</E1COGV_NUMBER>
      <E1COGV_HIGHERSEGMENT isInput="TRUE" type="CHAR">3</E1COGV_HIGHERSEGMENT>
      <E1COGV_FROMVALUE isInput="TRUE" type="CHAR">V</E1COGV_FROMVALUE>
      <E1COGV_TOVALUE isInput="TRUE" type="CHAR">V</E1COGV_TOVALUE>
      <E1COGS_NUMBER isInput="TRUE" type="CHAR">1</E1COGS_NUMBER>
      <E1COGS_HIGHERSEGMENT isInput="TRUE" type="CHAR">5</E1COGS_HIGHERSEGMENT>
      <E1COGS_SUBGROUP isInput="TRUE" type="CHAR">S</E1COGS_SUBGROUP>
      <E1COGHR_NUMBER isInput="TRUE" type="CHAR">1</E1COGHR_NUMBER>
      <E1COGHR_HIGHERSEGMENT isInput="TRUE" type="CHAR">7</E1COGHR_HIGHERSEGMENT>
      <E1COGHR_SNAME isInput="TRUE" type="CHAR">R</E1COGHR_SNAME>
      <E1COGHR_PRTCLASS isInput="TRUE" type="CHAR">R</E1COGHR_PRTCLASS>
      <E1COGHR_AUTHGR isInput="TRUE" type="CHAR">R</E1COGHR_AUTHGR>
      <E1COGSR_NUMBER isInput="TRUE" type="CHAR">1</E1COGSR_NUMBER>
      <E1COGSR_HIGHERSEGMENT isInput="TRUE" type="CHAR">8</E1COGSR_HIGHERSEGMENT>
      <E1COGSR_XSUPPRESS isInput="TRUE" type="CHAR">S</E1COGSR_XSUPPRESS>
      <E1COGSR_PRTCLASS isInput="TRUE" type="CHAR">S</E1COGSR_PRTCLASS>
      <E1COGSR_LNAME isInput="TRUE" type="CHAR">S</E1COGSR_LNAME>
      <E1COGVT_NUMBER isInput="TRUE" type="CHAR">1</E1COGVT_NUMBER>
      <E1COGVT_HIGHERSEGMENT isInput="TRUE" type="CHAR">10</E1COGVT_HIGHERSEGMENT>
      <E1COGVT_LANGU isInput="TRUE" type="CHAR">T</E1COGVT_LANGU>
      <E1COGVT_DESCRIPT isInput="TRUE" type="CHAR">T</E1COGVT_DESCRIPT>
      <E1COGVT_LANGU_ISO isInput="TRUE" type="CHAR">T</E1COGVT_LANGU_ISO>
      <E1COGVR_NUMBER isInput="TRUE" type="CHAR">1</E1COGVR_NUMBER>
      <E1COGVR_HIGHERSEGMENT isInput="TRUE" type="CHAR">11</E1COGVR_HIGHERSEGMENT>
      <E1COGVR_XSUPPRESS isInput="TRUE" type="CHAR">E</E1COGVR_XSUPPRESS>
      <E1COGVR_PRTCLASS isInput="TRUE" type="CHAR">E</E1COGVR_PRTCLASS>
      <E1COGVR_LNAME isInput="TRUE" type="CHAR">E</E1COGVR_LNAME>
      </COGRP_TMP_PROC>
      </Statement>
      </ns0:RTACOGRP_RECEIVER_MT>
    Now in message monitoring error is showing like this...
    <i>Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC' (structure 'Statement'): java.sql.SQLException: General error</i>
    Now in Component Monitoring error is showing like this....
    <i>Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC' (structure 'Statement'): java.sql.SQLException: General error</i>
    I have tested the stored procedure in sql by giving the same values , it was successfully executed..
    Can you please tell me where is the error still in structure ...
    Thanks in Advance,
    Murthy.

  • Process multiple documents in zip file without using ccBPM in PI

    Hi,
    Is it possible for PI to handle multiple documents within a zipped source file without the use of ccBPM?
    For example, I have an incoming source zip file containing 0.pdf, a,xml, z.pdf respectively,  After having the sender communication channel uncompress the zip file, each pdf file should be pushed to a directory on a file server, and the xml file should go through a message mapping.
    Is this possible to process all of the files without the use of ccBPM?
    Regards,
    Jim

    Hi Michal,
    Thank you for your response.  The example I provided is just one potential case.  In general, the zip file will always contain 1 xml file and 0-n PDFs, Word docs, or other types of documents.  Also, the first file in the zip may not always be the xml file, which is what I was trying to portray by my example.  Since I am not sure how many non-xml files will be included, I did not know if I could handle all of them directly, without ccBPM.
    At this point, I am leaning towards using a script preprocessor to uncompress the zip, then for each file found, push the xml file to an NFS channel which will process/map the xml, and push every other file type to another NFS channel to copy these documents to a predetermined directory on a predetermined server.
    What are your thoughts on this approach?
    Thanks and Regards,
    Jim

  • File Upload and download without asking/specifing the path

    Hi,
    I have a requirement in which user must be able to edit the Abode offline form by clicking on edit link. On clicking the link document must open (either download to some temporary location) in new window and user must be able to edit & to save the changes and also user must be able to check in or upload the file without asking for the location (source location).
    1. Is it possible to achive the similar functionality in WebDynpro ABAP?
    Like we open a document by clicking a link and we do changes and save the file and user clicks a button Check In and the document (which we edited) is uploaded to the application?
    If yes could you please provide some information.
    2. Is it possible in WDA to download a file to a temporary location and open the file for user editing & saving and also provide a option in applicaiton to upload the file from this temporary directory?
    -- In GUI frontend services we can find the temporary directory ... but is it possible to achive this functionality in WDA?
    3. Using FileDownload UI Element, we have option to download a file (Inplace option) which will open the file in the page ..but is there any possibility to read the modified contents in the Webdynpro application?
    I mean can we achive the check in functionality using this approach? If yes could you please provide some information.
    Please suggest incase this functionality can be achived using some other methods
    Thanks and best regards,
    Suresh

    Hi,
    Please check these Links,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0e10426-77ca-2910-7eb5-d7d8982cb83f
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/exporting%20context%20data%20into%20excel%20using%20the%20web%20dynpro%20binary%20cache.pdf
    Regards,
    <b>Ramganesan K</b>

Maybe you are looking for