SAX StartElement - Enumerating over attributes

Hello
In my StartElement event handler method I want to enumerate over all attributes found for an element, is this possible does anyone know?
Thanks
Jon

Done
int length = attributes.getLength();
int i;
System.out.println("Attributes:");
for(i=0;i<length;i++) {
String name = attributes.getLocalName(i);
String value = attributes.getValue(i);
System.out.println(name + ": " + value);
}

Similar Messages

  • Error processing request in sax parser  No 'action' attribute found in XML

    Hi All,
            I am doing a FILE to JDBC Scenario.  I just want to send a data from file to Sql Db table. For this I have written a stored procedure to insert the row in a table.
    This is the message mapping for FILE to JDBC ….
    Sender                                                                   Receiver
    *FILESENDER_MT  1..1    FILESENDER_DT     * SPRECEIVER_MT    1..1
        .NO                    1..1    xsd:string                    * Statement           1..1   string
        .Name                1..1    xsd:string                      *user_PROC       1..1                                                                               
    action            1..1required
                                                                                *No                                                                               
    isInput        1..1  string
                                                                                    type           1..1  string
                                                                                *Name
                                                                                    isInput        1..1  string
                                                                                    type           1..1  string 
    Mapped Values....
    Statement is mapped with <b>FILESENDER_MT</b>
    action attribute is mapped with "<b>EXECUTE</b>" Constant
    No is mapped with <b>NO</b>
    Name is mapped with <b>Name</b>
    for both isInput is mapped with <b>TRUE</b>
    for both type is mapped with <b>CHAR</b>
    Here is the my stored procedure.....
    CREATE PROCEDURE [dbo].[user_PROC]
    @NO char(10),  @Name char(10)  AS
    insert into FILE2JDBC values('a','ab')
    GO
    when i run this stored procedure in Sql directly it was executed successfully....
    I have checked In SXMB_MONI status is showing green...
    xml messages from SXMB_MONI ....
    this is the message from payloads of Inbound Message
    <PRE> <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:FILESENDER_MT xmlns:ns0="http://www.prospectadelhi.com/DELHI_FILE2JDBC">
      <NO>111</NO>
      <NAME>murthy</NAME>
      </ns0:FILESENDER_MT></PRE>
    this is the message from payloads of Request Message Mapping
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:SPRECEIVER_MT xmlns:ns0="http://www.prospectadelhi.com/DELHI_FILE2JDBC">
    - <Statement>
    - <user_PROC>
      <action>EXECUTE</action>
    - <NO>
      <isInput>TRUE</isInput>
      <type>CHAR</type>
      </NO>
    - <Name>
      <isInput>TRUE</isInput>
      <type>CHAR</type>
      </Name>
      </user_PROC>
      </Statement>
      </ns0:SPRECEIVER_MT>
    this is the error showing in runtime workbench>component monitoring->communication channel monitoring-->Receiver Communication Channel....
    <b>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)</b>
    Can any body tell me whether the problem is in Mapping or in Data Type Structure..
    Please resolve this issue....
    Thanks in Advance,
    Murthy.

    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:SPRECEIVER_MT xmlns:ns0="http://www.prospectadelhi.com/DELHI_FILE2JDBC">
    - <Statement>
    <b>- <user_PROC>
    <action>EXECUTE</action></b>
    - <NO>
    <isInput>TRUE</isInput>
    <type>CHAR</type>
    </NO>
    - <Name>
    <isInput>TRUE</isInput>
    <type>CHAR</type>
    </Name>
    </user_PROC>
    </Statement>
    </ns0:SPRECEIVER_MT>
    The Action should be a Attribute of Element user_Proc as,
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:SPRECEIVER_MT xmlns:ns0="http://www.prospectadelhi.com/DELHI_FILE2JDBC">
    - <Statement>
    <b>- <user_PROC action="Execute"></b>- <NO>
    <isInput>TRUE</isInput>
    <type>CHAR</type>
    </NO>
    - <Name>
    <isInput>TRUE</isInput>
    <type>CHAR</type>
    </Name>
    </user_PROC>
    </Statement>
    </ns0:SPRECEIVER_MT>
    Likewise isInput and Type should be Attributes and not Elements .
    Regards
    Bhavesh

  • Enumeration over Hashtable

    I feel quite noobie. I need an enumeration over a hashtable I have. I develop using Java 6 (the latest version). My experience with Java was before that. Enumeration has changed, and I can not find an example on what I need to do.
    This is what I try to accomplish:
    import java.util.Hashtable;
    import java.util.Enumeration;
        private Hashtable customers
        private Customer customer
            // Fill the Hashtable
         ArrayList companyList = (ArrayList) token; // Filled from XML-RPC
         for (i=0; i < companyList.size(); i++) {
              Customer customer = new Customer ((String) companyList.get(i));
              companies.put(customer.getName(), customer);
            // Now add some functionality to a few Customer objects
    // ============ Add some products to a few Customer =====================
    Enumeration<V> e = companies.keys();
    while (e.hasMoreElements() && i < 10) {
         // Add a product to a Customer
    // ============ Add some products to a few Customer =================But the problem is, my Editor (Eclipse Europa) gives the following error:
    V cannot be resolved to a typeThis is what I would have done in the past:
    import java.util.Hashtable;
    import java.util.Enumeration;
        private Hashtable customers
        private Customer customer
            // Fill the Hashtable
         ArrayList companyList = (ArrayList) token; // Filled from XML-RPC
         for (i=0; i < companyList.size(); i++) {
              Customer customer = new Customer ((String) companyList.get(i));
              companies.put(customer.getName(), customer);
            // Now add some functionality to a few Customer objects
    // ============ Add some products to a few Customer =====================
    Enumeration e = companies.keys();
    while (e.hasMoreElements() && i < 10) {
         // Add a product to a Customer
    // ============ Add some products to a few Customer =================What do I need to do to enumerate over a few elements of my Hashtable?
    TIA,
    Abel

    Like this?
    import java.util.*;
    class Customer {
        private String name;
        Customer(String name) {
            this.name = name;
        public String getName() {
            return name;
        public void doSomething() {}
    public class X {
        void f(Map<String, Customer> companies, List<String> companyList) {
            for (String customerName: companyList) {
                companies.put(customerName, new Customer(customerName));
            int count = 0;
            for(Customer c : companies.values()) {
                c.doSomething();
                if (++count >= 10)
                    break;
    }

  • XML sax startElement

    Hey all,
    I have a simple xml file and when ever I try to use startElement to print something out when it encounters an element,
    nothing happens,
    the endElement is working fine and it prints out Test when ever it finds a closed tag, but the startElement doesn't seem
    to work when it gets an open tag,
    public void startElement(String uri, String localName, String qName, Attributes atts)
            throws SAXException {
        System.out.print("Test");
    }Anyone got any ideas what im doing wrong?
    Thanks!

    The only thing I can think of is that you possible have a "Attributes" class somewhere (and imported it) and thus don't override the real startElement(), but overload it instead.
    If that's not the problem, you'll need to provide a SSCCE so that we can see the problem in action.

  • Selection over attribute

    Hi everybody,
    in level A the characteristic KPI has been
    configured as "set restrictions in package". Selection in the package has been restricted to the values "C" of attribute KPITYPE of the characteristic KPI.
    According to the KPI master data table
    only the entry PIN4 fulfills this
    criteria (i.e. value = "C"). During execution, however, the system
    also selects the entries FRA 4 & PUR 4.
    Does anybody have any idea why that could be?

    Hi Marc,
    thanks for your answer. Unfortunately the executing an ACR for the affected InfoObject did not help.
    Question: if the master data is active what relevance does an ACR have to this problem?  Am I wrong to believe that an ACR is only relevant for the updating of aggregates? 
    Here is the current system stand:
    SAP_BASIS 620 0051 SAPKB62051 SAP Basis Component
    SAP_ABA   620 0051 SAPKA62051 Cross-Application Component
    SAP_BW    310 0021 SAPKW31021 Business Information Warehouse
    PI_BASIS  2003_1_6200007 SAPKIPYH57 PI_BASIS 2003_1_620 : Add-On Del
    ST-PI     2005_1_6200002 SAPKITLQG2 SAP Solution Tools Plug-In
    BI_CONT   330 0016 SAPKIBICQ6 Business Intelligence Content  
    FINBASIS  150 0021 SAPK-15021INFINAdd-On FINBASIS 1.5: Installatio
    SEM-BW    320 0021 SAPKGS3221 Add-On SEM-BW 3.2 : Installation
    Greetings,
    Martin

  • How to Create XML file with SAX parser instead of DOM parser

    HI ALL,
    I am in need of creating an XML file by SAX parser ONLY. As far as my knowledge goes, we can use DOM for such purpose(by using createElement, creatAttribute ...). Can anyone tell me, is there any way to create an XML file using SAX Parser only. I mean, I just want to know whether SAX provides any sort of api for Creatign an element, attribute etc. I know that SAX is for event based parsing. But my requirement is to create an XML file from using only SAX parser.
    Any help would be appreciated
    Thanx in advance
    Kaushik

    Hi,
    You must write a XMLWriter class yourself, and that Class extends DefaultHandle ....., the overwrite the startElement(url, localName, qName, attributeList), startDocument(), endElement().....and so on.
    in startElement write your own logic about how to create a new element and how to create a Attribute list
    in startDocument write your own logic about how to build a document and encodeType, dtd....
    By using:
    XMLWriter out = new XMLWriter()
    out.startDocument();
    Attribute attr1 = new Atribute();
    attr1.add("name", "value");
    out.startElement("","","Element1", attr1);
    Attribute attr2 = new Atribute();
    attr2.add("name", "value");
    out.startElement("","","Element2", attr2);
    out.endElement("","","Element2");
    out.endElement("","","Element1");
    out.endDocument();

  • How to create new XML file using retreived XML content by using SAX API?

    hi all,
    * How to create new XML file using retreived XML content by using SAX ?
    * I have tried my level best, but output is coming invalid format, my code is follows,
    XMLFileParser.java class :-
    import java.io.StringReader;
    import java.io.StringWriter;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.sax.SAXTransformerFactory;
    import javax.xml.transform.sax.TransformerHandler;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.XMLFilterImpl;
    public class PdfParser extends XMLFilterImpl {
        private TransformerHandler handler;
        Document meta_data;
        private StringWriter meta_data_text = new StringWriter();
        public void startDocument() throws SAXException {
        void startValidation() throws SAXException {
            StreamResult streamResult = new StreamResult(meta_data_text);
            SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
            try
                handler = factory.newTransformerHandler();
                Transformer transformer = handler.getTransformer();
                transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                handler.setResult(streamResult);
                handler.startDocument();
            catch (TransformerConfigurationException tce)
                System.out.println("Error during the parse :"+ tce.getMessageAndLocation());
            super.startDocument();
        public void startElement(String namespaceURI, String localName,
                String qualifiedName, Attributes atts) throws SAXException {
            handler.startElement(namespaceURI, localName, qualifiedName, atts);
            super.startElement(namespaceURI, localName, qualifiedName, atts);
        public void characters(char[] text, int start, int length)
                throws SAXException {
            handler.characters(text, start, length);
            super.characters(text, start, length);
        public void endElement(String namespaceURI, String localName,
                String qualifiedName) throws SAXException {
            super.endElement("", localName, qualifiedName);
            handler.endElement("", localName, qualifiedName);
        public void endDocument() throws SAXException {
        void endValidation() throws SAXException {
            handler.endDocument();
            try {
                TransformerFactory transfactory = TransformerFactory.newInstance();
                Transformer trans = transfactory.newTransformer();
                SAXSource sax_source = new SAXSource(new InputSource(new StringReader(meta_data_text.toString())));
                DOMResult dom_result = new DOMResult();
                trans.transform(sax_source, dom_result);
                meta_data = (Document) dom_result.getNode();
                System.out.println(meta_data_text);
            catch (TransformerConfigurationException tce) {
                System.out.println("Error occurs during the parse :"+ tce.getMessageAndLocation());
            catch (TransformerException te) {
                System.out.println("Error in result transformation :"+ te.getMessageAndLocation());
    } CreateXMLFile.java class :-
    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();
    Sax.endElement("", "basic-metadata", "basic-metadata");* In CreateXMLFile.java
    class, I have retreived the xml content in the meta_data object, after that i have converted into character array and this will be sends to SAX
    * In this case , the XML file created successfully but the retreived XML content added as an text in between basic-metadata Element, that is, retreived XML content
    is not an XML type text, it just an Normal text Why that ?
    * Please help me what is the problem in my code?
    Cheers,
    JavaImran

    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    </code><code>Sax.endElement("", "basic-metadata", "basic-metadata");</code>
    <code class="jive-code jive-java">Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();     
    * I HAVE CHANGED MY AS PER YOUR SUGGESTION, NOW SAME RESULT HAS COMING.
    * I AM NOT ABLE TO GET THE EXACT OUTPUT.,WHY THAT ?
    Thanks,
    JavaImran{code}

  • XML to CSV using SAX Parser

    Hello
    I need to convert xml files to csv format using SAX Parser. The following code & outputs are as below:
    XML file:
    <Library>
    <Book>
         <Title>Professional JINI</Title>
         <Author>bs</Author>
         <Publisher>Oreilly Publications</Publisher>
    </Book>
    <Book>
         <Title>XML Programming</Title>
         <Author>java</Author>
         <Publisher>Mann Publications</Publisher>
    </Book>
    </Library>
    public class BooksLibrary extends DefaultHandler
    protected static final String XML_FILE_NAME = "C:\\library1.xml";
         public static void main (String argv [])
              // Use the default (non-validating) parser
              SAXParserFactory factory = SAXParserFactory.newInstance();
              try {
                   FileOutputStream fos=new FileOutputStream("C:/test.txt");
                   // Set up output stream
                   out = new OutputStreamWriter (fos, "UTF8");
                   // Parse the input
                   SAXParser saxParser = factory.newSAXParser();
                   saxParser.parse( new File(XML_FILE_NAME), new BooksLibrary() );
              } catch (Throwable t) {
                   t.printStackTrace ();
              System.exit (0);
         static private Writer out;
         //===========================================================
         // Methods in SAX DocumentHandler
         //===========================================================
         public void startDocument ()
         throws SAXException
              showData ("<?xml version='1.0' encoding='UTF-8'?>");
              newLine();
         public void endDocument ()
         throws SAXException
              try {
                   newLine();
                   out.flush ();
              } catch (IOException e) {
                   throw new SAXException ("I/O error", e);
         public void startElement (String name, Attributes attrs)
         throws SAXException
              showData ("<"+name);
              if (attrs != null) {
                   for (int i = 0; i < attrs.getLength (); i++) {
                        showData (" ");
                        showData (attrs.getLocalName(i)+"=\""+attrs.getValue (i)+"\"");
              showData (">");
         public void endElement (String name)
         throws SAXException
              showData ("</"+name+">");
         public void characters (char buf [], int offset, int len)
         throws SAXException
              String s = new String(buf, offset, len);
              showData (s);
         //===========================================================
         // Helpers Methods
         //===========================================================
         // Wrap I/O exceptions in SAX exceptions, to
         // suit handler signature requirements
         private void showData (String s)
         throws SAXException
              try {
                   out.write (s);
                   out.flush ();
              } catch (IOException e) {
                   throw new SAXException ("I/O error", e);
         // Start a new line
         private void newLine ()
         throws SAXException
              //String lineEnd = System.getProperty("line.separator");
              try {
                   out.write (", ");
              } catch (IOException e) {
                   throw new SAXException ("I/O error", e);
    --------------------------------------------------------------------------------------------------output is as follows:
    <?xml version='1.0' encoding='UTF-8'?>,
         Professional JINI
         bs
         Oreilly Publications
         XML Programming
         java
         Mann Publications
    Can anyone please tell me how to remove that indentation space & get the output as :
    <?xml version='1.0' encoding='UTF-8'?>, Professional JINI, bs, Oreilly Publications, XML Programming, java, Mann Publications
    Thanks

    By the way, there is a new feature in Java 5.0 (Tiger) called "Annotations."
    Since your code extneds DefaultHandler, you could specify a line with
    @Override
    before the definition of each of your methods. If you had used these, the compiler would have given an error since your methods did not override the methods of DefaultHandler.
    (If your code implemented ContentHandler, by contrast, using @Override is invalid because you need to implement all of the methods defined in the interface definition.)
    The other comment is that the safest way to handle characters() data is to use a StringBuilder/Buffer (StringBuilder is only valid in 5.0, StringBuffer has been around since Release 1.0) that you define in the startElement method. Use the append method to gather data presented to you in the characters() method and use toString() to harvest the data in the endElement method.
    Dave Patterson

  • SAX error parsing by element. need help!

    I am trying to develop a small method to that can parse an xml file and return an elements value. I got some code to build a SAXHandler. I have build the SAXHandler and have compiled it no problem.
    import java.io.*;
    import java.util.Hashtable;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    public class SAXHandler extends DefaultHandler {
    private Hashtable table = new Hashtable();
    private String currentElement = null;
    private String currentValue = null;
    public void setTable(Hashtable table) {
    this.table = table;
    public Hashtable getTable(){
    return table;
    public void startElement(String tag, Attributes attrs)
    throws SAXException {
    currentElement = tag;
    public void characters(char[] ch, int start, int length)
    throws SAXException {
    currentValue = new String(ch, start, length);
    public void endElement(String name) throws SAXException {
    if (currentElement.equals(name)) {
    table.put(currentElement, currentValue);
    I am using the following code to read the file in and parse it.
    public String getXMLElement(){
    try {
    File xmlFile = new File(appDataFile);
    FileReader xmlRead = new FileReader(xmlFile);
    XMLReader xmlParser;
    SAXParserFactory spf = SAXParserFactory.newInstance();
    SAXParser sp = spf.newSAXParser();
    SAXHandler handler = new SAXHandler();
    sp.parse(new InputSource(xmlRead), handler);
    i am recieving the following error when I try to run the servlet
    javax.servlet.ServletException: Cannot allocate servlet instance for path /JDtrack/servlet/JDTrack
    what makes this wierd is that is i take out the line
    sp.parse(new InputSource(xmlRead), handler);
    I do not get the error.
    I am newer to java and could use all the help I can get
    thanks.

    A few things to try to help identify the problem:
    -Create and InputSource before parsing the file. If the InputSource cannot be created, there may be a problem with accessing the file from your servlet.
    -Write a quick program to do the same thing from an application. If you can do this outside the servlet container, it may be a problem from running inside the servlet container.
    -The code you listed is in a try block, however the catch block is not listed. If you are not already doing so, place debug message (to console or log) from inside each catch block. If an exception is thrown but not handled corrrectly, the servlet container may just throw a ServletException.
    Hope this helps.

  • SAX error need help

    I am trying to develop a small method to that can parse an xml file and return an elements value. I got some code to build a SAXHandler. I have build the SAXHandler and have compiled it no problem.
    import java.io.*;
    import java.util.Hashtable;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    public class SAXHandler extends DefaultHandler {
    private Hashtable table = new Hashtable();
    private String currentElement = null;
    private String currentValue = null;
    public void setTable(Hashtable table) {
    this.table = table;
    public Hashtable getTable(){
    return table;
    public void startElement(String tag, Attributes attrs)
    throws SAXException {
    currentElement = tag;
    public void characters(char[] ch, int start, int length)
    throws SAXException {
    currentValue = new String(ch, start, length);
    public void endElement(String name) throws SAXException {
    if (currentElement.equals(name)) {
    table.put(currentElement, currentValue);
    I am using the following code to read the file in and parse it.
    public String getXMLElement(){
    try {
    File xmlFile = new File(appDataFile);
    FileReader xmlRead = new FileReader(xmlFile);
    XMLReader xmlParser;
    SAXParserFactory spf = SAXParserFactory.newInstance();
    SAXParser sp = spf.newSAXParser();
    SAXHandler handler = new SAXHandler();
    sp.parse(new InputSource(xmlRead), handler);
    i am recieving the following error when I try to run the servlet
    javax.servlet.ServletException: Cannot allocate servlet instance for path /JDtrack/servlet/JDTrack
    what makes this wierd is that is i take out the line
    sp.parse(new InputSource(xmlRead), handler);
    I do not get the error.
    I am newer to java and could use all the help I can get
    thanks.

    Have you tried this:
    String uri = xmlFile.toString();
    sp.parse("file:/"+uri);
    here's my code from my app
    try{
           MyParseingApp loader = new MyParseingApp();
           SAXParserFactory spf =   SAXParserFactory.newInstance();
           SAXParser sp = spf.newSAXParser();
           ParserAdapter pa = new ParserAdapter(sp.getParser());
           pa.setContentHandler(loader);
           pa.parse("file:/"+uri);
          catch(Exception ex){ System.out.println("......."+ex);}Here's an excellent link for xml and SAX parser's
    http://www.troubleshooters.com/tpromag/200103/codexercises.htm#_saxjava
    Jim

  • SAX help

    Hi all
    I want to know how to get index of attribute with SAX using javax.xml.parsers.SAXParser ,but when i use Attributes getIndex(QualifiedName); method it returns -1 but a single attribute is present in XML File ,so i wana know why it happens?
    thanks in advance

    hi
    try this.i dont know whether this is wht u meant.
    public void startElement(String qname,Attribute attr)throws SAXException
    for(int i=0; i<attr.getLength();i++)
                             System.out.println(attr.getIndex(attr.getQName(index)));
    }

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

  • JDBC receiver adapter: No 'action' attribute found in XML document

    Hi this is my target structure getting generated at the Receiver JDBC adapter
    I have checked the XML doc, still unable to figure out why in the RWB its showing the following error:
    "Message processing failed. 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)"
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_IF001 xmlns:ns0="http://vodafone.com/xi/IF001">
    <Statement>
    <OPCO_VPC_PO action="UPDATE">
    <access>
    <SO>0060000090</SO>
    <SO_ITEM>000010</SO_ITEM>
    </access>
    <key>
    <OPCO_PO>0002002291</OPCO_PO>
    <OPCO_PO_ITEM>00010</OPCO_PO_ITEM>
    </key>
    </OPCO_VPC_PO>
    </Statement>
    </ns0:MT_IF001>
    Kindly Help !!
    Thanks !!

    Hi,
                 Clearly stating that no action attribute .So, please take a look at the structure please do like this at your Data Type specification
    <i><b><b><root>
      <StatementName1>
    <dbTableName action=”UPDATE” | “UPDATE_INSERT”>
        <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2new</col2>
    </access>
    <key1>
    <col2>val2old</col2>
    <col4>val4</col4>
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName>
      </StatementName1>
    </root></b></b></i>
        refer the  following link
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    **Assign points if you found helpful
    Regards.,
    V.Rangarajan

  • JDBC - No 'action' attribute found in XML document - error

    Hi,
    I'm trying to write to SQL Server form File
    I successfully read from file, but fail to write.
    <b>My XML is :</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:SD_NEZIGA_OUT_MT xmlns:ns0="ssss.co.il:SD:Office_core_Neziga"><statement2 action="INSERT"><table>Employees</table><access><ID>000009</ID><Name>&#1497;&#1493;&#1504;&#1505;&#1497; &#1512;&#1493;&#1514;&#1497;</Name><Phone>972528288840</Phone><Manager>001037</Manager><DistManager>001037</DistManager><Password>D</Password><UserType>0</UserType><miskalID>0000</miskalID></access></statement2></ns0:SD_NEZIGA_OUT_MT>
    <b>Error from JDBC adapter:</b>
    TransformException error in xml processor class: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)
    Help me please.
    Best regards, Natalia.

    Hey
    Ur XML is not correct,it must be something like this
    <root>
    <StatementName1>
    <dbTableName action=”UPDATE” | “UPDATE_INSERT”>
    <table>realDbTableName</table>.....
    </StatementName1>
    if u look at the receiver structure of /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 this blog,action is an attribute of TEST and not STATEMENTNAME,for ur structure its an attribute of Statement2
    can u send ur receiver structure?
    thanx
    ahmad
    Message was edited by:
            Ahmad

  • JDBC receiver report error message:  attribute action missing

    Hello Colleagues,
    I am working on a scenario:
    SAP ECC>XI proxy>XI server>JDBC adapter>oracle database.
    SAP ECC is sending a request(SQL query) to get the result from DB.
    The payload is
    ==========================================================================
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_B1_MES_GETMAT_IN xmlns:ns1="http://boe.com.cn/b1/cim">
    - <root>
    - <stmt>
    - <Query action="SQL_QUERY">
      <access>SELECT productspecname AS MATNR, productiontype AS DISGR, SUBSTR(factoryname,1,1) AS SHOP FROM PRODUCTSPEC WHERE activestate = 'Active'</access>
      </Query>
      </stmt>
      </root>
      </ns1:MT_B1_MES_GETMAT_IN>
    ============================================================================
    As you might already seen, the action attribute is there, but i always get the error log:
    Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)
    I searched for the threads in forum but it seems, people get the same error always due to the wrong XML document.
    but i check my xml, it looks right. why still get the "action attribute missing" error...
    Best regards, Charlie Cai

       <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_B1_MES_GETMAT_IN xmlns:ns1="http://boe.com.cn/b1/cim">
    - <root>
    - <stmt>
    - <Query action="SQL_QUERY">
       <access>SELECT productspecname AS MATNR, productiontype AS DISGR, SUBSTR(factoryname,1,1) AS SHOP FROM PRODUCTSPEC WHERE activestate = 'Active'</access>
       </Query>
       </stmt>
       </root>
       </ns1:MT_B1_MES_GETMAT_IN>
    In your query, are you executing Select Statement ?
    For Target JDBC, you can Insert data in table, Update Data in table & Execute Stored Procedures from PI System.
    using Actions
    INSERT
    UPDATE
    EXECUTE.
    Change your scenario Action as per your requirement.
    No idea for ACTION = SQL_QUERY.

Maybe you are looking for

  • Safari not playing Quicktime from new website, all other browsers can

    Hi, I have a new web site being created. The developer has most of it done but has not been able to get the quicktime movies working correctly. The movies, animations, and panos, can be selected and play from Firefox on the MAC and PC, and IE on the

  • Request delivery schedule with fixed total delivery qty updated by MRP

    Hi Gurus, Please help on this issue. The issue is since in the "direct Purchase order", the delivery date is fixed & not updated by MRP, seems only delvery schedule line in Scheduling Agreement can be updated by MRP. Below is the requirement: 1) Use

  • IProblem: "One of the USB devices attached to this computer has ...."

    Hi, I'm having a problem with my iPod.. when I connect the iPod this message pops: "One of the USB devices attached to this computer has ...." I've searching a similar problem in the forums, and I have found many discussion about it, but any of them

  • Fill a Public PDF Form using Java.

    Hello, I have a PDF Form generated by some one. I would have to use java to fill that form and generate a printable version of it for the users to download and print. Any pointers of how i can acheive this would be greatly appreciated.

  • Implementing interface using Oracle Fusion

    Hey All, my company is responding to a tender but one of the things it specifies is that if any middleware is required it should be implemented using Oracle Fusion. Up until this point I'd never even heard of Oracle Fusion but am trying to get up to