Xtra characters & line in XML file

I have a file with several errors in our xml file created by Oracle, it is adding an extra character in the strings and created a second line for that string, which we have not been able to fix(see example) any ideas would be appreciated.
name = "BOX_NBR">1</variable><variable
name = "TOTAL_BOXES">2</variable><
*<variable_*
name = "DELIVERY_ID">5257664</variable><variable
name = "PICKING_ORDER">20104</variable><variable

Hi this is how the file generating and this is working when we run the job for number of labels up to 8 and when we try to run the job having more than 8 it is generating like below and if you look for the label 9 for one of the field it is having << characters instaed of one < before Variable name
</variable><<variable name = "LOE">46
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Whitespace is not allowed at this location. -->
<!DOCTYPE labels SYSTEM "C:\Program Files\Loftware Labeling\label.dtd">
<labels FORMAT="HOOKBOXI.lwl" PRINTERNAME="hisspq1" JOBNAME="1951594" QUANTITY="1">
<label><variable name = "LABEL_NUMBER">1</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
<label><variable name = "LABEL_NUMBER">2</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
<label><variable name = "LABEL_NUMBER">3</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
<label><variable name = "LABEL_NUMBER">4</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
<label><variable name = "LABEL_NUMBER">5</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
<label>
<variable name = "LABEL_NUMBER">6</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
<label><variable name = "LABEL_NUMBER">7</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
<label><variable name = "LABEL_NUMBER">8</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
<label><variable name = "LABEL_NUMBER">9</variable><variable name = "JOB">1951594</variable><variable name = "ASSEMBLY">6331M-7</variable><variable name = "FIXED_LOT_MULT">4</variable><variable name = "JOB_QTY">36</variable><variable name = "DUE_DATE">2013-03-16</variable><variable name = "WIRE">C072</variable><variable name = "HOOK_MACH">PLTN</variable><variable name = "LBS_TRAY">0</variable><variable name = "FINISH">TIN1</variable><variable name = "HEAT_TREAT">485</variable><variable name = "MYLAR_TEST_H">None</variable><variable name = "MYLAR_TEST_F">None</variable><variable name = "CLASS_CODE">DISCRETE</variable><variable name = "LOCATION">BLKSTG</variable><variable name = "SUBINV">STOCKROOM</variable><variable name = "DESCRIP">RNGE KOFFSET</variable><<variable name = "LOE">46</variable><variable name = "FBDRAW">D#6331-7</variable><variable name = "PRINT_DATE">2013-03-18</variable><variable name = "NBR_LABELS">9</variable><variable name = "FY1">1</variable><variable name = "FY2">3</variable>
</label>
</labels>
Appreciate for your help.

Similar Messages

  • How to export special characters into an XML file?

    Dear experts,
    We read files from our customers and save data into our customized table without any character changed, including some address fields. In those address fields, some special characters (not in our code page) are also kept. When we want to write these address fields into an XML file or flat file, the special charcters become "##" or not readable, can anyone help us to solve this issue?
    Question1: How to write special code to an external file?
    Question2: how to use 'CALL TRANSFORMATION' from an internal table to an XML file?
    Your answer is highly appreciated!
    Joanne

    Hi Joanne.
    Please check the below link.
    CALL TRANSFORMATION
    Before that u have to create one transformation program in STRANS tcode for using it in call transformation statement.
    Hope it will be useful.
    Regards,
    Lakshman

  • XSL-FO unable to read special characters from the XML file

    Team,
    please help on issue, when trying to read the text from XML file (Special characters like bullet). It is displaying as Question mark(?) in output in place of bullet..please proved any soultion.

    The "?" signals a character set mismatch issue - http://www.oracle.com/technetwork/database/globalization/nls-lang-099431.html - between client and database software

  • Flash Pro CS6 BUG - inconsistent end of line for xml files in library saved in xfl - MESSES UP SVN

    When saving in XFL with Flash CS6 on Mac (it also happened in CS5.5), the generated xml files in library often have inconsistend end of line, which blocks SVN commits and I have to manually go in the files and make them consistent.
    The XML nodes themselves all have \r\l as end of line, while, within <[CDATA[]]>, they only have \r.
    We think this happens only when creating new library items on mac, on windows it doesn't happen.
    This slows us down incredibly when working on a team using svn.
    SVN doesn't upload files with inconsistend line ending.
    Line ending shoul be consistent within the same xml file to make svn operations smooth.
    Check an image of the bug:
    http://www.pippoflash.com/_test/flash_bug_eof.png
    you can see clearly the differences.
    thank you
    Filippo

    Thanks Filippo, I could see that now!
    While I was investigating this, I found that this is even happening on a file created and saved on just Windows. I was able to reproduce this using the following steps
    - Create a new AS3 file on Windows
    - Drag out a component to the stage say a Button component from the User Interface section of the Components panel
    - Convert the button component to a Movie Clip Symbol
    - Save the file as XFL and examine the Library XML files (the End of Line is just 'LF' in CDATA section whereas it is 'CR LF' everywhere else)
    Since you were saying 'Items created in windows have no problem', does that means, SVN can commit those without any issues for you? And do you face problem only when the file is Created and Saved on Mac(where the end of line is just LF every where) but Modified and Re-saved on Windows(where the end of line is inconsistent)? 
    Thanks!
    Mohan

  • Replace a line on XML file

    If I have a XML file, like:
      <?xml version="1.0" ?>
    - <Fibonacci_Numbers>
      <fibonacci>1</fibonacci>
      <fibonacci>1</fibonacci>
      <fibonacci>2</fibonacci>
      <fibonacci>3</fibonacci>
      <fibonacci>5</fibonacci>
      <fibonacci>8</fibonacci>
      <fibonacci>13</fibonacci>
      <fibonacci>21</fibonacci>
      <fibonacci>34</fibonacci>
      <fibonacci>55</fibonacci>
      </Fibonacci_Numbers>and want to replace the number "21" for "37", without rewrite the whole file, how can I proceed?
    I writing the XML file with the PrintWriter API, and read I will try to read with the Element API, have some way to read the "fibonacci" attribute in the N-th position and replace it?
    Thanks in advance!

    If you want to change something in a text file, then by far the best way to do that is to create a new version of the file. That's what everybody always does. Why do you think you don't want to do that?

  • 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());

  • Special Characters while loading xml file in rtf template

    Hello,
    We use Oracle BI Publisher Enterprise to develop and publish reports. I am self taught and I am used to developing reports the following way
    1) Write SQL query
    2) View the Data format and copy the xml from the browser
    3) put in in textpad and use block mode to get rid of the hyphens
    4) save the xml on the desktop
    6) Now start a new rtf and go to plugins and load xml data
    7) load the xml data and then generate a tabular or cross tab report using the toolbar in plugins
    Now in step 6 when I try to load the xml data I am getting an error because some of the data elements have '<' or '>' than signs.
    What are my options now and how do I fix the xml to escape or put cdata sections around the special characters? Is there a better way to develop reports using the GUI?
    Thanks

    Hello,
    We use Oracle BI Publisher Enterprise to develop and publish reports. I am self taught and I am used to developing reports the following way
    1) Write SQL query
    2) View the Data format and copy the xml from the browser
    3) put in in textpad and use block mode to get rid of the hyphens
    4) save the xml on the desktop
    6) Now start a new rtf and go to plugins and load xml data
    7) load the xml data and then generate a tabular or cross tab report using the toolbar in plugins
    Now in step 6 when I try to load the xml data I am getting an error because some of the data elements have '<' or '>' than signs.
    What are my options now and how do I fix the xml to escape or put cdata sections around the special characters? Is there a better way to develop reports using the GUI?
    Thanks

  • Missing XSD line in XML file - how to add it?

    Dear all,
    We're trying to add in the XSD information to a file generated from R/3 by a standard program, which the developers don't want to adapt, as it's used by several other programs.  We'd like to do this in XI - does anyone know how or have any experience about why this would be a bad idea?
    Many thanks in advance,
    Lisa Howdle

    Hi Lisa,
    What I understood from your question is: SAP is generating a file and you want to add few more things to that file in XI.
    If we both are on the same page then you can create a xsd or extend the current xsd with the additional fields and then can load the file and send across XI.
    If we are not on the same page then can you throw some more light on this?
    Regards,
    ---Satish

  • Ignoring non-ASCII characters in XML file.

    Hello all who read this,
    I got the following problem. Trying to read an XML file which contains UTF-8 characters. My database doesnt support UTF-8 char set .... obviouselly.
    Below you will find my procedure for parsing XML file ... now i was wondering if there is a way (and how ) to ignore those "special" characters in my XML file.
    Thank you for you help!
    PROCEDURE xml_import is
    BEGIN
    DECLARE
      l_bfile   BFILE;
      l_clob    CLOB;
      l_parser  dbms_xmlparser.Parser;
      l_doc     dbms_xmldom.DOMDocument;
      l_nl      dbms_xmldom.DOMNodeList;
      l_n       dbms_xmldom.DOMNode;
      l_temp    VARCHAR2(1000);
      FILER     VARCHAR2(1000) := 'xml.xml';  
      TYPE tab_type IS TABLE OF X_XML%ROWTYPE;
      t_tab  tab_type := tab_type();
    BEGIN
      l_bfile := BFileName('XML_DIR',FILER);
      dbms_lob.createtemporary(l_clob, cache=>FALSE);
      dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
      dbms_lob.loadFromFile(dest_lob => l_clob,
                            src_lob  => l_bfile,
                            amount   => dbms_lob.getLength(l_bfile));
      dbms_lob.close(l_bfile);
      dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY''');
      l_parser := dbms_xmlparser.newParser;
      dbms_xmlparser.parseClob(l_parser, l_clob);
      l_doc := dbms_xmlparser.getDocument(l_parser);
      dbms_lob.freetemporary(l_clob);
      dbms_xmlparser.freeParser(l_parser);
      l_nl :=  dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/Doc/Upk');
      FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
        l_n := dbms_xmldom.item(l_nl,cur_emp);
        t_tab.extend;
        dbms_xslprocessor.valueOf(l_n,'@id',t_tab(t_tab.last).id);
        dbms_xslprocessor.valueOf(l_n,'line1',t_tab(t_tab.last).vr);
        dbms_xslprocessor.valueOf(l_n,'line2',t_tab(t_tab.last).used);
        dbms_xslprocessor.valueOf(l_n,'line3',t_tab(t_tab.last).got);
      END LOOP;
      FORALL i IN t_tab.first .. t_tab.last
        INSERT INTO X_XML VALUES t_tab(i);
      COMMIT;
      dbms_xmldom.freeDocument(l_doc);
    --EXCEPTION
    --  WHEN OTHERS THEN
    --    dbms_lob.freetemporary(l_clob);
    --    dbms_xmlparser.freeParser(l_parser);
    --    dbms_xmldom.freeDocument(l_doc);
    END;
    END;
    XML file structure:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <AjpesDokument>
    - <Ident vrsta="KOMP">
      <Datum>2011-06-17</Datum>
      <Ura>09:33:10</Ura>
      </Ident>
    - <Dolznik id="88888888">
      <DatumObdelave>2011-06-10</DatumObdelave>
      <Trr>56546654545</Trr>
      <PopolnoIme>Firm d.o.o.</PopolnoIme>
      <Ulica>Kičečeva ul</Ulica>
      <HisnaStev>026</HisnaStev>
      <PostaId>5421</PostaId>
      <Posta>MELJE</Posta>
      <IzpSif>00</IzpSif>
      <IzpNaziv>MELJE</IzpNaziv>
      <IzpNaslov>ČUPAVA</IzpNaslov>
      <IzpNaslov2>MELJE</IzpNaslov2>
    - <Upnik davcna="10232293">
      <Naziv>CMC GALVANIKA d.o.o.</Naziv>
      <Kraj>LEŠČE</Kraj>
      <VrstaPobota>2</VrstaPobota>
      <Prijavljeno>3227.12</Prijavljeno>
      <Pobotano>3227.12</Pobotano>
      </Upnik>
    - <Upnik davcna="11212191">
      <Naziv>AŽERO  d.o.o.</Naziv>
      <Kraj>MELJE</Kraj>
      <VrstaPobota>2</VrstaPobota>
      <Prijavljeno>219.30</Prijavljeno>
      <Pobotano>219.30</Pobotano>
      </Upnik>
      </Dolznik>
    </AjpesDokument>
    Edited by: 869620 on 1.7.2011 2:04

    869620 wrote:
    Hello all who read this,
    I got the following problem. Trying to read an XML file which contains UTF-8 characters. My database doesnt support UTF-8 char set .... obviouselly.It's not obvious as Oracle can certainly be configured for UTF-8.
    How about giving us some example XML and what you expect as output as there can be easier ways of extracting data from XML than using the dbms_xmldom package.
    The dbms_xmldom package is one way, but it's not necessarily the best, as I would tend to use that for processing XML based structure that I don't actually know (I have used it myself, for example, for parsing XML Schemas (XSD) to auto-generate code for producing XML to match that schema), but for extracting date from a known XML structure, I would probably use SQL's XMLTABLE functionality.
    And when you post code/data, please use the {noformat}{noformat} tags as detailed in the FAQ: {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Saving Croatian characters in XML file

    Hi,
    I'm trying to save Croatian characters into an XML file by using the windows-1250 encoding. For some reason, that doesn't work. Only the � and � characters (in upper and lower case) are OK. All other characters turn into ? signs, if you open the xml file.
    Here's my code:
    import org.dom4j.DocumentHelper;
    import org.dom4j.Element;
    import org.dom4j.Document;
    import org.dom4j.io.XMLWriter;
    import org.dom4j.io.OutputFormat;
    import java.io.*;
    public class test {
      public static final String ENCODING = "windows-1250";
      public static void main( String[] args ) {
        Element root = DocumentHelper.createElement( "XMLTest" );
        Document doc =  DocumentHelper.createDocument( root );
        Element elem = root.addElement( "t1" );
        try {
          String test = "&#269;&#263;��&#273;&#268;&#262;��&#272;";
          String x = new String(test.getBytes( ) , ENCODING);
          elem.setText( x );
          OutputFormat format = OutputFormat.createCompactFormat();
          format.setEncoding( ENCODING );
          format.setTrimText( false );
          FileOutputStream out = new FileOutputStream( new File( "testtest.xml" ) );
          XMLWriter writer = new XMLWriter( out, format );
          writer.setEscapeText( true );
          writer.setMaximumAllowedCharacter(255);
          writer.write( doc );
          writer.close();
        catch ( UnsupportedEncodingException e ) {
          e.printStackTrace();
        catch ( FileNotFoundException e ) {
          e.printStackTrace();
        catch ( IOException e ) {
          e.printStackTrace();
    }Thanks in advance for any help.
    Greet

    I assume that your java file has been saved in an encoding that can support the croatian characters?
    The problem is then probably in this area:
    String test = "&#269;&#263;��&#273;&#268;&#262;��&#272;";
    String x = new String(test.getBytes( ) , ENCODING);
    elem.setText( x );There is no need to encode a String. The only time an encoding becomes important is when converting from a String to bytes or converting bytes into a String.
    Try this instead:
    elem.setText("&#269;&#263;��&#273;&#268;&#262;��&#272;");By the way, there should be no need to escape the text in the XMLWriter.

  • Error while loading XML files into scott user

    Hi All,
    I'm new to xml files. I need to load xml files into database through OWB.
    I have xml file in my local machine & am trying to load into table PO of Scott. Scott is registered as repository user.
    Followed same steps as specified in userguide.
    But, when executing the procedure ( in two ways one as just table name, and other as user.table name) it is showing the below error:
    Procedure is:(1)--with username.tablename
    begin
    wb_xml_load(
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>&&SAMPLES_DIR.sample1.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target dateFormat="yyyy.MM.dd">scott.PO</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    end;
    ERROR at line 1:
    ORA-20006: Error occurred while truncating target database object SCOTT.PO.
    Base exception: ORA-01031: insufficient privileges
    ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
    ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
    ORA-06512: at "SCOTT.SAMPLE1", line 3
    ORA-06512: at line 1
    Procedure is:(2) with out username
    begin
    wb_xml_load(
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>&&SAMPLES_DIR.sample1.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target dateFormat="yyyy.MM.dd">PO</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    end;
    ERROR at line 1:
    ORA-20006: Error occurred while truncating target database object PO.
    Base exception: ORA-00942: table or view does not exist
    ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
    ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
    ORA-06512: at line 2
    xml file:
    <ROWSET>
    <ROW>
    <ID>100</ID>
    <ORDER_DATE>2000.12.20</ORDER_DATE>
    <SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
    <SHIPTO_STREET>500 Marine World Parkway</SHIPTO_STREET>
    <SHIPTO_CITY>Redwood City</SHIPTO_CITY>
    <SHIPTO_STATE>CA</SHIPTO_STATE>
    <SHIPTO_ZIP>94065</SHIPTO_ZIP>
    </ROW>     
    </ROWSET>
    Note: Everything works fine if I create PO table in OWBSYS user and execute the procedurein OWBSYS user. OWBSYS.PO table will be loaded.
    What privileges are missing, what shouldI do if I want to execute the procedure from scott user and load the table of scott.
    Thanks in advance for the help.
    Regards,
    Joshna

    Hi Joshna,
    Please follow below steps to load xml file to oracle database.
    1.First connect to owb (Design Center) through your repository owner user (ex : REP_OWNER).
    2. Import WB_XML_LOAD procedure . and exit to repository owner.
    3. connect to owb design center through your repository user (ex : REP_USER)
    Create New mapping and drag one Constant Operator and create one attribute, paste / edit following code
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>E:\SOURCE\emp.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target truncateFirst = "FALSE" dateFormat="yyyy.MM.dd">rep_user.emp</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    4. Drag pre mapping operator and select WB_XML_LOAD procedure
    5. Connect Constant Operator attribute to pre mapping operator.
    6. Drag two dummy tables and connect source to target. (ex : drag t1 (table) tab two times and connect.
    7. Validate and deploy the mapping.
    8. grant necessary grant command to rep_owner user to rep_user user.
    (Note : target truncateFirst = "FALSE" by default truncate the table. So you have to give grant privileges
    To rep_user , select ,insert, delete privileges.
    9. Execute the mapping , and check EMP table. (Note : before loading EMP table delete all records ).
    10 . If you want more description please go through the below link
    http://download.oracle.com/docs/html/A95931_01/apf.htm
    Regards
    Venkat

  • Problem when loading xml file using sql loader

    I am trying to load data into table test_xml (xmldata XMLType)
    i have an xml file and i want whole file to be loaded into a single column
    when i use the following control file and executed from command prompt as follows
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl direct=true;:
    LOAD DATA
    INFILE *
    TRUNCATE INTO TABLE test_xml
    xmltype(xmldata)
    FIELDS
    ext_fname filler char(100),
    xmldata LOBFILE (ext_fname) TERMINATED BY EOF
    BEGIN DATA
    /u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml
    the file is being loaded into table perfectly.
    unfortunatley i cant hardcode file name as file name will be changed dynamically.
    so i removed the block
    BEGIN DATA
    /u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml
    from control file and tried to execute by giving file path from command line as follows
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml direct=true;
    but strangely it's trying to load each line of xml file into table instead of whole file
    Please find the log of the program with error
    Loading of XML through SQL*Loader Starts
    SQL*Loader-502: unable to open data file '<?xml version="1.0"?>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Root>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Type>Forms</Type>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '</ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Type>PLL</Type>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '</ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    please help me how can i load full xml into single column using command line without hardcoding in control file
    Edited by: 907010 on Jan 10, 2012 2:24 AM

    but strangely it's trying to load each line of xml file into table instead of whole fileNothing strange, the data parameter specifies the file containing the data to load.
    If you use the XML filename here, the control file will try to interpret each line of the XML as being separate file paths.
    The traditional approach to this is to have the filename stored in another file, say filelist.txt and use, for example :
    echo "/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml" > filelist.txt
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=filelist.txt direct=true;

  • PLSQL changing XML file content

    Hello Experts,
    I have a task to do.
    I have to replace special characters from an XML file placed on the server through PLSQL.
    So that i created a plsql procedure.
    PROCEDURE REMOVE_SPECIAL_CHARS (p_file_name IN VARCHAR2)
    AS
    l_tmp_clob       CLOB                             DEFAULT EMPTY_CLOB();
    l_bfile          BFILE NULL;
    l_dest_offset    INTEGER            := 1;
    l_src_offset     INTEGER            := 1;
    l_outfile        UTL_FILE.file_type;
    lang_ctx         NUMBER             := DBMS_LOB.default_lang_ctx;
    warning          NUMBER NULL;
    l_dest_file      VARCHAR2(300) NULL;
    BEGIN
    mob_util_pck.log_write ('I','Inside REMOVE_SPECIAL_CHARS procedure(+)');
    l_dest_file:=SUBSTR (p_file_name, (INSTR (p_file_name, '/', -1, 1))+1);
    mob_util_pck.log_write ('I','Following File will be modified: '||l_dest_file);  
       l_bfile := BFILENAME ('MOBSEPAOUT', l_dest_file);
       DBMS_LOB.OPEN (l_bfile, DBMS_LOB.file_readonly);
       DBMS_LOB.createtemporary (l_tmp_clob, TRUE);
       DBMS_LOB.loadclobfromfile (dest_lob          => l_tmp_clob
                                , src_bfile         => l_bfile
                                , amount            => DBMS_LOB.getlength (l_bfile)
                                , dest_offset       => l_dest_offset
                                , src_offset        => l_src_offset
                                , bfile_csid        => DBMS_LOB.default_csid
                                , lang_context      => lang_ctx
                                , warning           => warning
       DBMS_LOB.CLOSE (l_bfile);
    mob_util_pck.log_write ('I','Deleting Old File');
       BEGIN
          mob_util_pck.delete_files ('MOBSEPAOUT'
                                   , l_dest_file
       END;
    mob_util_pck.log_write ('I','Before Replacing Characters');
       l_tmp_clob := REPLACE (l_tmp_clob, '€', 'E');
       l_tmp_clob := REPLACE (l_tmp_clob, '@', '(at)');
       l_tmp_clob := REPLACE (l_tmp_clob, '&', '+');
       l_tmp_clob := REPLACE (l_tmp_clob, 'à', 'a');
       l_tmp_clob := REPLACE (l_tmp_clob, 'é', 'e');
       l_tmp_clob := REPLACE (l_tmp_clob, 'è', 'e');
       l_tmp_clob := REPLACE (l_tmp_clob, 'ç', 'c');
       l_tmp_clob := REPLACE (l_tmp_clob, 'ù', 'u');
       l_tmp_clob := REPLACE (l_tmp_clob, 'ï', 'i');
       l_tmp_clob := REPLACE (l_tmp_clob, 'ù', 'u');
       l_tmp_clob := REPLACE (l_tmp_clob, '[', '(');
       l_tmp_clob := REPLACE (l_tmp_clob, ']', ')');
       l_tmp_clob := REPLACE (l_tmp_clob, '\', '/');
       l_tmp_clob := REPLACE (l_tmp_clob, '^', '.');
       l_tmp_clob := REPLACE (l_tmp_clob, 'ù', 'u');
       --l_tmp_clob := REPLACE (l_tmp_clob, '_', '-');
       l_tmp_clob := REPLACE (l_tmp_clob, '`', '''');
       l_tmp_clob := REPLACE (l_tmp_clob, '{', '(');
       l_tmp_clob := REPLACE (l_tmp_clob, '|', '/');
       l_tmp_clob := REPLACE (l_tmp_clob, '}', ')');
       l_tmp_clob := REPLACE (l_tmp_clob, '~', '-');
       l_tmp_clob := REPLACE (l_tmp_clob, 'À', 'A');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Á', 'A');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Â', 'A');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ã', 'A');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ä', 'A');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Å', 'A');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ç', 'C');
       l_tmp_clob := REPLACE (l_tmp_clob, 'È', 'E');
       l_tmp_clob := REPLACE (l_tmp_clob, 'É', 'E');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ê', 'E');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ë', 'E');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ì', 'I');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Í', 'I');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Î', 'I');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ï', 'I');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ñ', 'N');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ò', 'O');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ó', 'O');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ô', 'O');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Õ', 'O');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ö', 'O');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ù', 'U');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ú', 'U');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Û', 'U');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ü', 'U');
       l_tmp_clob := REPLACE (l_tmp_clob, 'Ý', 'Y');
       mob_util_pck.log_write ('I','After Replacing Special Characters');
       mob_util_pck.log_write ('I','Before Creating New File '||l_dest_file);
       DBMS_XSLPROCESSOR.clob2file(l_tmp_clob, 'MOBSEPAOUT', l_dest_file);
       mob_util_pck.log_write ('I','After Creating New File '||l_dest_file);
       mob_util_pck.log_write ('I','Inside REMOVE_SPECIAL_CHARS procedure(-)');
    END REMOVE_SPECIAL_CHARS;
    This procedure is working fine for some special characters. But some special characters are getting replaced by different characters before performing the replace so it is causing wrong replacement of characters.
    eg- i need to replace & by +
    but it is changing it to +amp which is incorrect.
    Is it something related to characters encoding?
    Please help.
    Regards-
    Vikrant

    eg- i need to replace & by +
    but it is changing it to +amp which is incorrect.
    Is it something related to characters encoding?
    Due to its special meaning in the XML language, occurrences of the ampersand character '&' have be escaped to &amp; as well as '<', '>' and '"' respectively to &lt;, &gt; and &quot;.
    So in short, do not replace the ampersand character.

  • XMLBeans, XML files, and CharConversionException

    Hi, I am using XMLBeans to read in an XML file. However, my XML file fails to parse. I get the following exception:
    java.io.CharConversionException: Characters larger than 4 bytes are not supported: byte 0x8f implies a length of more than 4 bytes
    I do not have any foreign characters in my XML file; the file is valid and well-formed. Consequently, I am completely puzzled as to why I am gettin this error. Any suggestions?
    I am also using WebLogic Server 8.1 SP3 on a Unix box.

    To answer my own question:
    After much debugging, I determined that and errant character was getting introduced at the beginning of the xml file that failed to parse. As a result of this errant charcter, it was no longer a valid XML file and hence failed to parse...
    How that character is getting there is another question, possibly outside the realm of this forum.
    Hope this helps someone.

  • Read data from xml files and  populate internal table

    Hi.
    How to read data from xml files into internal tables?
    Can u tell me the classes and methods to read xml data..
    Can u  explain it with a sample program...

    <pre>DATA itab_accontextdir TYPE TABLE OF ACCONTEXTDIR.
    DATA struct_accontextdir LIKE LINE OF itab_accontextdir.
    DATA l_o_error TYPE REF TO cx_root.
    DATA: filename type string ,
                 xmldata type xstring .
    DATA: mr      TYPE REF TO if_mr_api.
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
    WRITE xmldata.
    TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.
    LOOP AT itab_accontextdir INTO struct_accontextdir.
        WRITE: / struct_accontextdir-context_id,
               struct_accontextdir-context_name,
               struct_accontextdir-context_type.
        NEW-LINE.
        ENDLOOP.</pre>
    <br/>
    Description:   
    In the above code snippet I am storing the data in an xml file(you know xml is used to store and transport data ) called 'xml_accontextdir.xml' that is uploaded into the MIME repository at path 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'.
    The below API is used to read a file in MIME repo and convert it into a string that is stored in ' xmldata'. (This is just a raw data that is got by appending the each line of  xml file).
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
        Once the 'xmldata' string is available we use the tranformation to parse the xml string that we have got from the above API and convert it into the internal table.
    <pre>TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.</pre>
    Here the trasnsformation 'id ' is used to conververt the source xml 'xmldata' to resulting internal table itab_accontextdir, that have same structure as our xml file 'xml_accontextdir.xml'.  In the RESULT root of the xml file has to be specified. (In my the root is 'shiva'). 
    Things to be taken care:
    One of the major problem that occurs when reading the xml file is 'format not compatible with the internal table' that you are reading into internal table.  Iin order to get rid of this issue use one more tranformation to convert the data from the internal table into the xml file.    
    <pre>TRY.
          CALL TRANSFORMATION id
            SOURCE shiv = t_internal_tab
            RESULT XML xml.
        CATCH cx_root INTO l_o_error.
      ENDTRY.
      WRITE xml.
      NEW-LINE.</pre>
    <br/>
    This is the same transformation that we used above but the differnce is that the SOURCE and RESULT parameters are changed the source is now the internal table and result is *xml *string. Use xml browser that is available with the ABAP workbench to read the xml string displayed with proper indentation. In this way we get the format of xml file to be used that is compatable with the given internal table. 
    Thank you, Hope this will help you!!!
    Edited by: Shiva Prasad L on Jun 15, 2009 7:30 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 11:56 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 12:06 PM

Maybe you are looking for

  • Loading multiple tables with SQL Loader

    Hi, I want to load multiple tables from a single data file using SQL Loader. Here's the basic idea of what I want. Let's say I have two tables, table =T1 and table T2: SQL> desc T1; COL1 VARCHAR2(20) COL2 VARCHAR2(20) SQL> desc T2; COL1 VARCHAR2(20)

  • Error on creation of PR using BAPI_PR_CREATE

    Hello All, while creating a PR using BAPI_PR_CREATE getting an error simultaneously a PR is creating The error is Enter a G/L Account. Even when I am providing with the G/L Account number. There is one input field as SERIAL_NO in tables PRACCOUNT and

  • HP LaserJet Pro 200 M251n Color Printer driver for Window NT

    Hi All,  Good day. I'm here to seek for help.  Currently i bought a HP LaserJet Pro 200 M251n Color Printer, but i want it to use at Window NT.  I need driver to run this printer at Window NT. Anyone can help and advice me? Thanks. 

  • CE 7.2 Deployment error: Model version is lower

    Hi, just another problem when I try to deploy a product: Status message: The version 1.5.41 of the model to be imported is lower than the version 1.5.44 of the model present in namespace active.. Can anybody help me on this? Thanks in advance!

  • Garageband saying songs I am trying to import aren't audio files

    Every time I try to move one of my songs over from iTunes into GarageBand on my Macbook Pro it says it is not an audio file. However all of my songs are mp3. I have searched for how to fix it all over Garageband and tried to find help online. Please