Error in SAX Parsing

Hi Team,
I am facing an issue while implementing a java mapping through SAX parsing.I am explaining it in details:
Source Structure   
=================
MT_OB_SAX_MAP
>NUMBER1
>NUMBER2
Target Structure
==================
MT_IB_SAX_MAP
>ADD
>MUL
>SUB
The code that has been written to achieve this is:
//import java.io.FileInputStream;
//import java.io.FileOutputStream;
import com.sap.aii.mapping.api.StreamTransformation;
import java.io.*;
import java.util.Map;
import javax.xml.parsers.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
public class saxmapfinal1 extends DefaultHandler implements StreamTransformation
private Map map;
private OutputStream out;
private boolean input1 = false;
private boolean input2 = false;
private int number1;
private int number2;
private int addvalue;
private int mulvalue;
private int subvalue;
String lineEnd =  System.getProperty("line.separator");
public void setParameter (Map param)
map = param;
public void execute (InputStream in, OutputStream out)
throws com.sap.aii.mapping.api.StreamTransformationException
DefaultHandler handler = this;
SAXParserFactory factory = SAXParserFactory.newInstance();
try {
      SAXParser saxParser = factory.newSAXParser();
      this.out = out;
      saxParser.parse(in, handler);
catch (Throwable t)
t.printStackTrace();
private void write (String s) throws SAXException{
try{
out.write(s.getBytes());
out.flush();
catch (IOException e){
throw new SAXException("I/O error", e);
public void startDocument () throws SAXException{
write("<?xml version=1.0 encoding=UTF-8?>");
write(lineEnd);
write("<ns0:MT_IB_SAX_MAP xmlns:ns0=urn:bp:xi:hr:edm:test:100>");
write(lineEnd);
public void endDocument () throws SAXException
write("</ns0:MT_IB_SAX_MAP>");
try { out.flush();
catch (IOException e) {
throw new SAXException("I/O error", e);
public void startElement (String namespaceURI, String sName, String qName,Attributes attrs)  
throws SAXException {
String eName = sName;
if ("".equals(eName))
eName = qName;
if(eName.equals("NUMBER1"))
input1 = true;
if(eName.equals("NUMBER2"))
input2 = true;             
public void endElement (String namespaceURI, String sName, String qName) throws SAXException {
String eName = sName;
if ("".equals(eName))
eName = qName;
if(eName.equals("NUMBER1"))
input1 = false;
if(eName.equals("NUMBER2"))
input2 = false;
public void characters(char[] chars,int startIndex, int endIndex) throws SAXException
String dataString =
new String(chars, startIndex, endIndex).trim();
if (input1) {
try
number1 = Integer.parseInt(dataString);
} catch(NumberFormatException nfe)
if (input2) {
number2 = Integer.parseInt(dataString);
if (input2 == true)
addvalue = number1 + number2;
mulvalue =  number1 * number2;
subvalue = number1 - number2;
write("<ADD>" + addvalue +"</ADD>");
write(lineEnd);
write("<MUL>" + mulvalue +"</MUL>");
write(lineEnd);
write("<SUB>" + subvalue +"</SUB>");
write(lineEnd);
But while executing this in XI I am facing an error as "XML not well formed" but I am not able to know why this error is comming.
Can you please throw some light why this error is happening.?IWhat us the error in the code and what should be the correct code?
Many thanks for the support that I got in past.
Regards
Atanu Mazumdar
Edited by: ATANU1 on Apr 4, 2011 4:16 PM

Just use characters() method for building string. Use endElement() to process that string.

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

  • JDBC receiver adapter - Error processing request in sax parser

    Hello,
    I want to INSERT idoc data via JDBC adapter into a MS SQL database. After digging through SAP Help, numerous blogs and forum discussions on SDN and even posting an OSS message I still get the same error:
    'Error: 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)'
    When testing my mapping in the Integration Repository the resulting XML message is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Employee xmlns:ns0="http://prodrive.nl/xi/HRMasterdata/HRMD_A_2_d_bcommerp">
       <STATEMENT>
          <T_PD_Employees action="INSERT">
             <access>
                <KeyTag>00088888</KeyTag>
                <PerNo>00088888</PerNo>
             </access>
          </T_PD_Employees>
       </STATEMENT>
    </ns0:Employee>
    The connection to the database is fine, Sender adapter with a SELECT * works perfect.
    Can anyone help me solve this problem? I'm lost.
    Best regards,
    Roelof Jan Bouwknegt

    Hi Bhavesh,
    I have tried out the change you suggested. Without success. Message I get back is
    - 2006-12-28 10:34:08 CET: Error: 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)
    structure in testtool:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Employee xmlns:ns0="http://prodrive.nl/xi/HRMasterdata/HRMD_A_2_d_bcommerp">
       <STATEMENT>
          <T_PD_Employees action="INSERT">
             <ACCESS>
                <KEYTAG>00088888</KEYTAG>
                <PERNO>00088888</PERNO>
             </ACCESS>
          </T_PD_Employees>
       </STATEMENT>
    </ns0:Employee>
    Somehow the SAX  parser doesn't like the result of my mapping. Maybe there is something wrong with the structure cardinality. Let me describe what I have built:
    XSD:
    WA_T_PD_Employees - Complex Type
    > STATEMENT - Element - Occurence = 1
    >> T_PD_Employees - Element - Occurence = 1
    >>> STATEMENT - Attribute - Occurence = optional
    >>> access - Element - Occurence = 1..Unbounded
    Best regards Roelof Jan and thanks for your quick response

  • Problem in error handling in SAX Parser

    My application takes xml message as input.
    If a error was found while validating, an <Errors> <Error></Error></Errors> element is included in the orginal message and send back to the user.
    While validation xml message I found an interesting problem.
    Created a false entry for the root element attribute.
    Traced method invocation.
    First the call back error method is invoked,then the start element(stored the attributes inside the starElement to a instance variable).When i tried to print the attribute .As the error method got invoked first
    if showed "null".
    But when i created the same case with the child elements attributes
    even though invoking of the methods happens in the same sequence
    attributes got assigned and can print the attibutes values.
    xml is schema vaidated .Is there any restriction that root element should not contain attributes.Can any one explain how the call back methods are invoked .
    Regards
    Dheeraj
    // import statements here
    public class OperationHandler extends DefaultHandler {
         private static Logger logger = Logger.getLogger(OperationHandler.class.getName());
         private Attributes attributes;
         private StringBuffer dataStore;
    public OperationHandler() {
    dataStore = new StringBuffer(100);
         * Receive notification of the end of an document.
         public void startDocument() {
              logger.debug("OperationHandler: startDocument");
         * Receive notification of the beginning of the element.
         public void startElement(String uri, String lName,
                                            String qName, Attributes attributes) {
              logger.debug("OperationHandler: startElement" + lName);
              dataStore.setLength(0);
         * Receive notification of the end of an element.
         public void endElement(String uri, String lName, String qName) {
              logger.debug("OperationHandler: endElement");
              // bussiness specific code
         * Receive notification of the end of an document.
         public void endDocument() {
              logger.debug("OperationHandler: endDocument");
         public void error(SAXParseException saxe) {
              logger.debug("OperationHandler : error");
              System.out.println("CurrentElement"+currentElement +" "+"Attributes" + attributes);
                   if(attributes != null) {
                        for(int i=0; i < attributes.getLength(); i++) {
                             System.out.println(saxe.getColumnNumber());
                             System.out.println(saxe.getLineNumber());
                             System.out.println(saxe.getMessage());
         public void fatalError(SAXParseException saxe) throws SAXException {
              logger.debug("Fatal error while parsing message");
              logger.error("Error " + saxe.getMessage() );
         public void warning(SAXParseException saxe) throws SAXException {
              logger.warn("Warning " + saxe.getMessage() );
         * Receive notification of character data inside an element.
         public void characters(char[] charData,int start, int length) {
              String strData = new String(charData, start, length);
              if(strData != null) {
                   strData.trim();
                   dataStore.append(strData);
    }

    Hi Muruganand,
    Is the data load failing while loading data or while activating?
    if the data load is failing at activation, thers is nothing you can do except editing the records in PSA and then update them.
    As far as i have seen, the data load to DSO fails in Activation and not while loading. this is the reason why the records are not collected in error stack
    unlike if it is a cube, the data load fails while loading collecting the recods in error stack.
    hope this helps,
    Thanks and Regards,
    Srinath.

  • Error processing request in sax parser

    Hi all,
    I am doing an asynchronous interface.
    It is an interface from IDOC to JDBC. While testing the interface,am getting the following error
    "Error processing request in sax parser: Error when executing statement for table/stored proc. 'put_delivery' (structure 'Statement_Delivery'): java.lang.NumberFormatException: null"
    Any kind of help is appreciated.
    Regards,
    Thireesha.

    Hello,
    Please refer to SAP NOTE 801367.
    In advanced tab, use logSQLQuery-->true. Tt will display the actual sql statement in audit log instead of xml format.
    You can copy this sql statement and execute directly in database to check the problem.
    -Rahul

  • Error processing request in sax parser...Excepciu00F3n de E/S: Connection reset

    Hello,
    I've RFC to JDBC interface.
    Sometimes in the RWB me the following error message,
    <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'LISMATWQ' (structure 'STATEMENT'): java.sql.SQLException: Excepción de E/S: Connection reset</SAP:AdditionalText>
    <SAP:ApplicationFaultMessage namespace="" />
    How can I prevent?
    Thanks very much,

    Hello,
    the error does not always appear, sometimes the interface works well and others do not (even when the data are the same) I find no solution to this error,
    anyone have any idea?
    thanks very much

  • Error processing request in sax parser: Error when executing statement...

    Hello,
    I want to INSERT data from R/3 System to AS400 via JDBC adapter into a DB2 database. The interfaces from R/3 are Ok. but i have some problems to use the JDBC in DB2 Systems. The message in comunitation channel is:
    " Error processing request in sax parser: Error when executing statement for table/stored proc. 'SPE106TST' (structure 'STATEMENT'): java.sql.SQLException: SPE106TST de SADMT1 no válido para la operación."
    in the SXMB_MONI -> Request Message Mapping payloads this:
    The connection to the database is fine, Sender adapter with a SELECT * works perfect.
    Please Can anyone help me solve this problem? I'm lost.
    Best regards,
    Edited by: Nicola Occhipinti on May 22, 2008 7:40 PM

    Hi Nicola,
    This error occurs when the receiver side structure is incorrect.
    Your structure seems to be correct.
    Please use lower case for action, access and table.
    Please check whether the field names are exactly the same as in the actual Database table sadmt1.SPE106TST.
    Check if the table has permissions to write.
    You can try an alternate structure without using table tag.
    <ns0:MT_XMLSQL_SPEC xmlns:ns0="urn:damm.com/pi/EmployeeMasterData">
    <STATEMENT>
    <sadmt1.SPE106TST action="INSERT">
    <access>
    <CODEMP>D</CODEMP>
    <CODPRO>00202339</CODPRO>
    <NOMPRO>ROSIQUE PERALSGENIS</NOMPRO>
    <DIRPRO>GIRONA</DIRPRO>
    <POBPRO>S. VICENS HORTS</POBPRO>
    <RUTA>0</RUTA>
    <ORDEN>0</ORDEN>
    <NOMINA>S</NOMINA>
    </access>
    </sadmt1.SPE106TST>
    </STATEMENT>
    </ns0:MT_XMLSQL_SPEC>
    Hope your problem gets solved.
    -Shamly

  • I've a problem with errors message in the sax parser

    Hello,
    I'm quite new to Java.
    I'm trying to create a SAX parser for my XML file, with a XML schema.
    When my pars run a XML file, the following mistakes go out:
    1)org.sax.SAXParseException:s4s-elt-must-match: the content of 'restriction' must match (annotation?,.....)
    2)org.sax.SAXParseException: src-ct.0.1:Complex Type Definition Rappresentation Error for type..... Element 'sequence' is invalid,misplaced or occurs to often
    but I don't understand where I must go in the schema to correct.
    Many thanks!

    Hi,
    Perhaps it would help if you post your XML file.

  • SAX Parser Error in JDBC Adapter

    I am using a JDBC adapter to execute SQL statements during mapping runtime. However, it issues me an error regarding the SAX Parser when I have a '&' character in the SQL statement. I am not able to remove the & since it is in the database that I access and it will result to data inconsistency. I think that when the JDBC adapter of XI converts the SQL string to the XML format, it does not include the amp; string to the &, thus causing the SAX Parser to throw the error.
    Is there someway I can configure the JDBC adapter in such a way that it will replace the & with &amp;. Or is there a way to display how the JDBC adapter converts the SQL statement to its the XML representation of it?
    Thanks a lot.

    Hi,
    For this kind of situation use some unique character combination  like "#@!" for replacing "&" then parse the document and the restore the "&" later .
    For this convert the input stream into Strring and then replace the occurences of "&".
    regards.

  • SAX parser errors in services-messages.log

    I'm having some issues with a just installed ZCM 11.3a server. I'm getting a lot of errors:
    org.jdom.JDOMException: Could not load default SAX parser: org.apache.xerces.parsers.SAXParser: SAX2 driver class org.apache.xerces.parsers.SAXParser not found: org.apache.xerces.parsers.SAXParser
    in services-messages.log
    I have googled for the error message but can't find anything related to ZCM. Any idea about how to fix it?

    jlmendez Wrote in message:
    > I'm having some issues with a just installed ZCM 11.3a server. I'm
    > getting a lot of errors:
    >
    > org.jdom.JDOMException: Could not load default SAX parser:
    > org.apache.xerces.parsers.SAXParser: SAX2 driver class
    > org.apache.xerces.parsers.SAXParser not found:
    > org.apache.xerces.parsers.SAXParser
    >
    > in services-messages.log
    >
    > I have googled for the error message but can't find anything related to
    > ZCM. Any idea about how to fix it?
    Which OS did you install ZCM 11.3a on? I'm guessing Linux based.
    HTH.
    Simon Flood
    Novell Knowledge Partner

  • SAX Parser error when installing Oracle CCG 5.5.1

    I am trying to install Oracle CCG on Windows 2008. I already have my PeopleSoft system installed on the same box, running weblogic and jdk1.7.0_03.
    After setting the required environment variables, when I run the command "install.bat -f ccg-551-install.apf" from ccg_install folder, I get the following error:
    Starting Oracle Installation Engine 1.2.1
    Running from working directory C:\CCG\ccg_stage\
    ORACLE_HOME is C:\app\Administrator\product\11.2.0\dbhome_1
    JAVA_HOME is C:\Program Files\Java\jdk1.7.0_03
    LAUNCH_CLASSPATH is C:\app\Administrator\product\11.2.0\dbhome_1\jdbc\lib\classe
    s12.jar;C:\CCG\ccg_stage\install.jar;"C:\app\Administrator\product\11.2.0\dbhome
    _1\lib";C:\Program Files\Java\jdk1.7.0_03\lib;C:\app\Administrator\product\11.2.
    0\dbhome_1\lib;%CLASSPATH%
    Oracle CCG Installer -- Version 1.2.1 Build(installer12-Maint-1.2.1.2)
    Copyright 2009 Oracle. All rights reserved.
    Initializing. Please wait...
    FileParser: Parse error occurred: Could not load default SAX parser: org.apache.
    xerces.parsers.SAXParser: SAX2 driver class org.apache.xerces.parsers.SAXParser
    not found: org.apache.xerces.parsers.SAXParser
    Could not load default SAX parser: org.apache.xerces.parsers.SAXParser: SAX2 dri
    ver class org.apache.xerces.parsers.SAXParser not found: org.apache.xerces.parse
    rs.SAXParser
    I have tried downloading xerces.jar file and placed in the CLASSPATH folder but it did not help either. I do not have much knowledge about java and need help from someone who has installed CCG on windows.
    Thank you in advance

    Several things I would recommend here:
    1. Use JDK 1.5 instead of 1.7, I'm pretty sure 1.7 isn't supported (Don't ask why) - [http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html|http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html]
    2. Make sure to exit out all DOS command windows, then open a new one then go through setting all the environment variables, and using the same DOS command run the install command, otherwise all environment variables will be lost.
    I hope that helps.

  • OBIEE Writeback error Sax parser Expected entity name with ampersand gt/lt

    Hi,
    I've enabled OBIEE 10.1.3.3.2 on Suse Linux 9.x writeback successfully for an OBIEE report, however if any of the fields contain XML special characters like ampersand, less than, greater than symbols etc when I save I get error:
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Sax parser returned an exception. Message: Expected entity name for reference, Entity publicId: , Entity systemId: , Line number: 1, Column number: 795
    Error Details
    Error Codes: UH6MBRBC:E6MUPJPH
    Xml parsed: <writeBack template="entry"><record action="update"><value columnID="c10">C</value><value columnID="c2">Jun-08</value><value columnID="c5">0001</value><value columnID="c1">NET RESULT</value><value columnID="c7">T000</value><value columnID="c3">Total X & X</value>...
    I don't really want to have to use replace function on all the fields in the report to remove special characters + train users not to enter them in editable field.
    Anyone got any ideas how to get around this?
    Thanks,
    Gareth

    Hi
    I am getting this error in writeback while submitting
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Sax parser returned an exception. Message: Unterminated entity reference, 'M', Entity publicId: , Entity systemId: , Line number: 1, Column number: 85
    Error Details
    Error Codes: UH6MBRBC:E6MUPJPH
    Xml parsed: <writeBack template="CPE_writeback"><record action="update"><value columnID="c0">H&M SWEDEN</value><value columnID="c1">7/5/2010</value><value columnID="c2">8/26/2010</value><value columnID="c11">Administrator</value><value columnID="c7">BOOKED</value><value columnID="c10"> y</value><value columnID="c9">H&M SWEDEN ;7/5/2010 ;8/26/2010 ;BOOKED</value></record></writeBack>
    I think the problem is with '&' or might be with something else, if i choose other options form dropdowns its does not give me any error. only fot this customer "H&M SWEDEN"
    can any one please tell me what workaround i can do.. the obi version is 10.1.3.2

  • Fatal error XML-0121 in a valid XML file in v2 of SAX parser

    Attachments: "1|type=text/plain|desc=Logging of Fatal error using v2 of SAX parser |file=v2_loggin
    .txt|";"2|type=text/plain|desc=Logging of Fatal error using v2 of java SAX parser |17078|file=v2_l
    gging.txt|"
    Dear XML team,
    I am using the SAX parser version 2.0.2.4. When parsing a valid
    XML of approx. 3,5 Megabytes i get a fatal error XML-0121
    saying 'End tag does not match start tag
    <CORRESPONDENTIENAAM1>...'
    We checked the xml on the well formedness with tools like XML
    Spy and IE5. The XML is valid!
    We did some testing on the XML with the SAXSample class and we
    noticed that the error is related to the use of Entity
    References. When we removed the Entity Reference &apos; the XML
    was parsed correctly.
    We also noticed that if we cut the XML in two smaller parts it
    was also parsed correctly.
    I attached the output of the parser, as well as the output of
    the SAXSample class.
    I hope you can fix this problem!
    With kind regards,
    Rolf van Deursen.
    null

    Update: I have attempted to use xmlparserv2.jar dated 12/23/08 that is packaged with jDeveloper 11g preview, but am still receiving the same message.

  • JAVAMAP-Sax Parser ...............Linkage error when loading the class.

    Dear all,
    Do we have any extra things to execute the Java mapping using the Sax Parser?
    When I am executing the interface mapping ,I am getting the" Linkage error when loading the class" error.
    Kindly let me know your personnel maildId so that I can mail you the screen shots.
    Thanks,
    Srinivasa

    Dear sunil,
    Find the File.
    Source:
    <MTO_FTP_MAT_DETAILS>
    <MATDETAILS>
    <MAKTX>
    <MATNR>
    <WERKS>
    <LABST>
    <MEINS>
    <PERCNT>
    TARGET
    MTI_FTP_MAT_DETAILS
    <MATDETAILS>
    <MAKTX>
    <MATNR>
    <WERKS>
    <LABST>
    <MEINS>
    <PERCNT>
    Source:
    <MTO_FTP_MAT_DETAILS>
    <MATDETAILS>
    <MAKTX>
    <MATNR>
    <WERKS>
    <LABST>
    <MEINS>
    <PERCNT>
    TARGET
    MTI_FTP_MAT_DETAILS
    <MATDETAILS>
    <MAKTX>
    <MATNR>
    <WERKS>
    <LABST>
    <MEINS>
    <PERCNT>
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import com.sap.aii.mapping.api.StreamTransformation;
    class Echo {
    public static OutputStream out;
    public class myEcho extends DefaultHandler implements StreamTransformation {
    private Map map;
    public void setParameter(Map param) {
    map = param;
    public void execute(InputStream in, OutputStream out) {
    DefaultHandler handler = this;
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
    SAXParser saxParser = factory.newSAXParser();
    Echo.out = out;
    saxParser.parse(in, handler);
    } catch (Throwable t) {
    t.printStackTrace();
    public void startDocument() throws SAXException {
    try {
    Echo.out.write("<?xml version='1.0' encoding='UTF-8'?>".getBytes());
    } catch (IOException e) {
    e.notify();
    public void endDocument() throws SAXException {
    try {
    Echo.out.flush();
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    public void startElement(String namespaceURI, String sName, // simple name
    String qName, // qualified name
    Attributes attrs) throws SAXException {
    String eName = sName; // element name
    if ("".equals(eName))
    eName = qName; // not namespace-aware
    if ("ns0:MTO_SAP_MAT_DETAILS".equals(qName)) {
    try {
    Echo.out.write(("<MTI_FTP_MAT_DETAILS>").getBytes());
    } catch (Exception e) {
    e.printStackTrace();
    } else {
    try {
    Echo.out.write(("<" + qName + ">").getBytes());
    } catch (Exception e) {
    e.printStackTrace();
    public void endElement(String namespaceURI, String sName, // simple name
    String qName // qualified name
    ) throws SAXException {
    String eName = sName; // element name
    if ("".equals(eName))
    eName = qName; // not namespace-aware
    if ("ns0:MTO_SAP_MAT_DETAILS".equals(qName)) {
    try {
    Echo.out.write(("</MTI_FTP_MAT_DETAILS>").getBytes());
    } catch (Exception e) {
    e.printStackTrace();
    } else {
    try {
    Echo.out.write(("</" + qName + ">").getBytes());
    } catch (Exception e) {
    e.printStackTrace();
    public void characters(char buf[], int offset, int len)
    throws SAXException {
    String s = new String(buf, offset, len);
    try {
    Echo.out.write(s.getBytes());
    } catch (Exception e) {
    e.printStackTrace();

  • Error in SAX using validating parser

    I am using the SAX parser and I am getting an "s4s-elt-schema-ns" error trying to validate xml before parsing it. Please note that my xml schema file specifies a "xsi:noNamespaceSchemaLocation" file. Does anyone have any ideas?
    Thanks - twins.fan
    The error is follows:
    =============
    SystemID file:///G:/VendorIndependent/homebaseOverrides.xml
    Line Number - 2
    Column Number - 119
    Message - s4s-elt-schema-ns: The namespace of element 'Overrides' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
    ==============
    The first few lines of the xml schema file is:
    ==========
    <?xml version="1.0" encoding="US-ASCII"?>
    <Overrides xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="overrideValidate.xsd">
    <Property hotelID="46777">
    <Override>
    <City Value="Curacao"/>
    <Confirmation> <City Value="Cura??Ao"/> </Confirmation>
    </Override>
    </Property>
    ==============

    My problems is solved after importing fix pack 4 for websphere 3.5.
    Regards,
    Lee

Maybe you are looking for

  • Front panel of a vi pops up when i start my top level vi how can i stop this

    i have a vi that whos front panel should display when the user clicks a front panel button(test instructions), however this vi pops up when i run the top level vi. I can manually close the vi, but how do i stop this? i tried modifying the Sub VI Set

  • My bill is not what the sales rep promised me when I signed up!!!!!!

    So my last post seems to be deleted...  Lets start again.   I signed up for service and it was installed on June 15th.  When I signed up the sales rep told me I would get internet, cable, and phone for $119 per month and I could rent a modem for $10

  • How do I convert a word doc to pdf?

    I cannot seem to convert a word doc to a pdf- it keeps taking me back to the subscription page and I already have signed up for that. HELP!

  • Calculation of VAT on Freight

    Dear Team, As we require sometimes to calculate VAT on freight part as well along with exciseable line item of material..we tried , also made a separate tax code for freight to calculate VAT  only.But we getting result but system calculated excise an

  • Communication Channel in error

    Communication Channel in error though the error has been resovled. New files are processed succesfully !!! CC still in RED. I tried the basic steps which can change the status .( by deactivating the channel and activating the same , stopped and start