Converting XML structure to SQL string

Hi,
how can I convert an existing XML structure into a SQL string? It's important to do this manually, because there are additional data necessary to complete the recordset.
The XML structure is:
<File>
<Recordset>
<Column>Data</Column>
</Recordset>
</File>
The additional data are 4 columns for each recordset to implement into the SQL string.
The SQL string should be something like
"INSERT INTO table (Add_Column, Column, Column, Column) VALUES (Add_Data, Data, Data, Data)"
If anyone has source code performing operations like that I'd be grateful 'cause I'm quite new to Java and have not the experience in such transform ops.

Which package includes xml sax?You can download it from,
http://java.sun.com/xml/download.html.
I can send you some sample pgms too, if you want.If you would, I'd be grateful.
Marko

Similar Messages

  • XML structure inside WS string response

    Hi all,
    I have a PI scenario and I can find a solution.
    The scenario is a ABAP PROXY that consume a WS, this is no problem, the problem is that the web service returns a string parameter, and inside the string parameter there is a XML structure.
    My doubt is, how can mapping it to get the response in a structured data type instead of a string??
    Thanks a lot
    Raú

    Hi ,
            Is the return type is an XML structure? Then use java mapping using DOM parser to extract the string from response. Then the mapping program can generate the required target structure from the string. 
    you can if possible let the forum members know, the response xml message and the structure of target XML as per your requirement. Finally also the version of PI you are working is also important as java mapping procedure is different for PI7.0 and PI 7.1.
    As Stefan has pointed out without java mapping it will be almost impossible to extract the target XML from String. Still you can try  out with XSLT mapping, but I don't think that will be easy task to do. Java mapping is the correct procedure to solve your problem. Finally forum members will be able to assist you if you provide complete source and target XML structure alog with  sample string response. you can reuse java mapping code for multiple interfaces within same SWCV. The part or module which will be calling the common code with different input parameters will vary accross interfaces depending on your need.
    regards
    Anupam
    Edited by: anupamsap on Sep 29, 2011 1:55 PM
    Edited by: anupamsap on Sep 29, 2011 2:21 PM

  • Error While converting xml to sap abap string.

    Hi Experts,
    As i am doing an cross Application from SAP to .Net and vice versa.I am receiving an xml from .Net and it should be converted to ABAP string Using the following function module   SMUM_XML_PARSE 
    And the following string i am receiving from .net
    <Root><qApprovalInfo><RequesterId>xxxx</RequesterId><RequesterName>xxx</RequesterName><ApproverId>xxxx</ApproverId><ApproverLevel>1</ApproverLevel><PendingApprovalId>0200169911</PendingApprovalId><CreatedDate>20/07/2011</CreatedDate><CreatedBy>xx</CreatedBy><ModifiedDate>2011-07-20 16:45</ModifiedDate><ModifiedBy>xxxx</ModifiedBy><ApplicationCode>EPAY</ApplicationCode><WorkFlowCode>EPX</WorkFlowCode><ApprovalStatus>APPROVED</ApprovalStatus><ActionComments><![CDATA[APPROVED(through  Desktop)]]></ActionComments><Mode>CREATE</Mode><ActionSource>DESKTOP</ActionSource></qApprovalInfo><qApprovalHidden><Approverl>40002664</Approver><EmployeeId>40016515</EmployeeId></qApprovalHidden></Root>
    In this xml i am getting all the values except the <ActionComments><![CDATA[APPROVED(through Desktop)]]></ActionComments>
    is their any way to convert that CDATA value?..
    have anybody come across the following issue ?...
    can anybody provide the solution for this?.
    Edited by: basavaraj.p on Aug 29, 2011 10:54 AM

    Hi,
    SMUM_XML_PARSE is a simplified, unreleased and undocumented version of the powerful, released and documented iXML
    If you look at the GET_ELEMENT subroutine in that function module, you'll see that the nodes of type CO_NODE_CDATA_SECTION are simply ignored.
    The simpliest thing for you, maybe, is to duplicate the code of SMUM_XML_PARSE (as it is rather easy to handle), and add a section to GET_ELEMENT. You'll have also to use IF_IXML_CDATA_SECTION interface and ixml_iid_cdata_section constant.
    Documentation is here: [SAP Library: Interface if_ixml_cdata_section|http://help.sap.com/saphelp_nw70/helpdata/en/bb/576658dca511d4990b00508b6b8b11/frameset.htm ]
    Best regards,
    Sandra

  • How to convert XML content into SQL INSERT statements

    Hi all,
    I'm very new to XML. Forgive me if I don't use technical XML terms. :-)
    We are planning to convert SQL queries into XML format using a third party tool.
    After that we have to read the XML files and use the tokens to insert into custom tables.
    So, basically we have to create INSERT statements using the data stored in the XML file.
    How do we go about reading / parsing the XML file in Java?
    Pls help!
    Regards,
    Sam

    This is the requirement with an example.
    eg. if the following SQL query is fed into the 3rd party system,
    select last_name,job_id,salary from employees a, deptno b
    where a.deptno = b.deptno
    the output would be,
    <?xml version="1.0" ?>
    <sqlscript dbvendor="MSSQL">
    <fullselectstmt nestlevel="0">
    <subselectstmt><selectclause><fieldlist>
    <field><fieldname>
    <attr>
    <sourcetoken toketype="" dbobjtype="field">last_name</sourcetoken>
    </attr>
    </fieldname>
    </field>
    <field><fieldname>
    <attr>
    <sourcetoken toketype="" dbobjtype="field">job_id</sourcetoken>
    </attr>
    </fieldname>
    </field>
    <field><fieldname>
    <attr>
    <sourcetoken toketype="" dbobjtype="field">salary</sourcetoken>
    </attr>
    </fieldname>
    </field>
    </fieldlist></selectclause>
    <fromclause><joinlist><join nestlevel="0">
    <lztable><simpletable><attr>
    <sourcetoken toketype="" dbobjtype="table">employees</sourcetoken>
    </attr><aliasclause withas="false"><sourcetoken toketype="" dbobjtype="table alias">a</sourcetoken></aliasclause></simpletable></lztable></join><join nestlevel="0">
    <lztable><simpletable><attr>
    <sourcetoken toketype="" dbobjtype="table">deptno</sourcetoken>
    </attr><aliasclause withas="false"><sourcetoken toketype="" dbobjtype="table alias">b</sourcetoken></aliasclause></simpletable></lztable></join></joinlist></fromclause>
    <whereclause><expression exprtype="Expr_Comparison" exproop="="><attr>
    <sourcetoken toketype="" dbobjtype="table alias">a</sourcetoken>
    <sourcetoken toketype="" dbobjtype="unknown">.</sourcetoken>
    <sourcetoken toketype="" dbobjtype="field">deptno</sourcetoken>
    </attr><attr>
    <sourcetoken toketype="" dbobjtype="table alias">b</sourcetoken>
    <sourcetoken toketype="" dbobjtype="unknown">.</sourcetoken>
    <sourcetoken toketype="" dbobjtype="field">deptno</sourcetoken>
    </attr></expression>
    </whereclause></subselectstmt></fullselectstmt>
    </sqlscript>
    So, using the output file, the list of columns (under token "field") last_name,job_id and salary should be inserted into LIST_COLUMNS table. So 3 INSERT statements should be created for 3 columns.
    The list of tables (under token "table") employees and dept should be inserted into LIST_TABLES table. So 2 INSERT statements should be created for the 2 tables.
    Regards,
    Sam

  • Converting XML Document Message (xsd string) to BPEL

    Hello, I have written a BPEL flow that takes input from a client (a query) then Invokes a scynchronous data service (passes some parameters to run a federated query) that returns an xsd string that is a set of records in XML (see below). I want to understand how I use the Assign function (or other method) to consume the xsd string (XML file) in BPEL.
    I set up complexType elements in the WSDL schema as follows (snippet, not complete WSDL) to manage the input and output:
    <element name="QueryRequest" type="tns:inputType"/>
    <element name="QueryResult" type="tns:recordType"/>
    <complexType name="inputType">
    <sequence>
    <element name="username" type="string"/>
    <element name="password" type="string"/>
    <element name="city" type="string"/>
    <element name="state" type="string"/>
    <element name="zip" type="string"/>
                             </sequence>
    </complexType>
                        <complexType name="recordType">
                             <sequence>
                                  <element name="customer" type="tns:customerType" maxOccurs="unbounded"/>
                             </sequence>
                        </complexType>
                        <complexType name="customerType">                                             
    <sequence>
    <element name="accountNumber" type="string"/>
    <element name="lastName" type="string"/>      
    <element name="firstName" type="string"/>
    <element name="email" type="string"/>
    <element name="city" type="string"/>
    <element name="state" type="string"/>
    <element name="zip" type="string"/>
                             </sequence>                         
                        </complexType>
    Information:
    - BPEL PM 2.1.2
    - BPEL Designer Eclipse Plugin 0.9.10
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>1</CustNum>
    <CustLName>aLName</CustLName>
    <CustFname>aFName</CustFname>
    <CustAddress>111 a street</CustAddress>
    <CustCity>austin</CustCity>
    <CustState>TX</CustState>
    <CustZip>78000</CustZip>
    </customer>
    <customer>
    <CustNum>2</CustNum>
    <CustLName>bLName</CustLName>
    <CustFname>bFName</CustFname>
    <CustAddress>112 b street</CustAddress>
    <CustCity>austin</CustCity>
    <CustState>TX</CustState>
    <CustZip>78000</CustZip>
    </customer>
    <customer>
    <CustNum>5</CustNum>
    <CustLName>eLName</CustLName>
    <CustFname>eFName</CustFname>
    <CustAddress>115 e street</CustAddress>
    <CustCity>austin</CustCity>
    <CustState>TX</CustState>
    <CustZip>78002</CustZip>
    </customer>
    <customer>
    <CustNum>6</CustNum>
    <CustLName>fLName</CustLName>
    <CustFname>fFName</CustFname>
    <CustAddress>116 f street</CustAddress>
    <CustCity>austin</CustCity>
    <CustState>TX</CustState>
    <CustZip>78002</CustZip>
    </customer>
    <customer>
    <CustNum>BOBA101</CustNum>
    <CustLName>Austin</CustLName>
    <CustFname>Bob</CustFname>
    <CustAddress>101 Main Street</CustAddress>
    <CustCity>Austin</CustCity>
    <CustState>TX</CustState>
    <CustZip>78112</CustZip>
    </customer>
    <customer>
    <CustNum>JOHNA103</CustNum>
    <CustLName>Austin</CustLName>
    <CustFname>John</CustFname>
    <CustAddress>112 Main</CustAddress>
    <CustCity>austin</CustCity>
    <CustState>tx</CustState>
    <CustZip>78113</CustZip>
    </customer>
    </recordset>
    Any and all help is greatly appreciated.

    Hi Sean,
    Can you forward your Project files to us by zipping it and renaming the .zip to .zap and send it to [email protected] with the same subject as this thread?
    Regards,
    Dhaval

  • Converting XML to String in OSB

    Hi All,
    Is there any function (apart from fn-bea:serialize function) for converting XML payload to a String in OSB. Please let me know.
    Thanks,
    Bpeltechie

    That's how it's worded by W3C
    http://www.w3.org/TR/REC-xml/#syntax
    The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment,
    a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the
    strings " &amp; " and " & lt; " respectively. The right angle bracket (>) may be represented using the string " & gt; ", and must, for compatibility, be
    escaped using either " & gt; " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end
    of a CDATA section.Note that it says left angle bracket must not appear in their literal form, but the right angle bracket may be represented using the string " &amp;gt; "
    Cheers,
    Vlad

  • How to convert a structure to string?

    Hi all,
    I want to convert a structure to a string variable. we have a structure with length 1020 we want to convert it into string.
    Thanks in advance
    hari

    Hi,
           If you know the structure that the table needs to be moved to then it is possible with assign..
    pls check the code below...
    REPORT  yytest88 LINE-COUNT 20 NO STANDARD PAGE HEADING.
    TYPES: BEGIN OF ty_test,
             f1(10),
             f2(10),
           END OF ty_test.
    DATA : wa_type(10) VALUE 'TY_TEST'.
    DATA : BEGIN OF itab OCCURS 0,
             f(20),
           END OF itab.
    DATA : BEGIN OF itab1 OCCURS 0,
             f(35),
           END OF itab1.
    FIELD-SYMBOLS : <fs1> TYPE any.
    FIELD-SYMBOLS : <fs2> TYPE any.
    FIELD-SYMBOLS : <fs3> TYPE any.
    itab-f = '12345678901234567890'.
    APPEND itab.
    itab-f = '09876543210987654321'.
    APPEND itab.
    LOOP AT itab.
      ASSIGN itab-f TO <fs1> CASTING TYPE (wa_type).
      IF sy-subrc = 0.
        do.
          assign component sy-index of structure <fs1> to <fs2>.
          if sy-subrc = 0.
            if itab1-f is initial.
              concatenate itab1-f <fs2> into itab1-f.
            else.
              concatenate itab1-f <fs2> into itab1-f separated by 'BREAK'.
            endif.
          else.
            exit.
          endif.
        enddo.
        APPEND itab1.
        clear : sy-subrc, itab1-f.
      ENDIF.
    ENDLOOP.
    LOOP AT itab1.
      WRITE :/ itab1-f.
    ENDLOOP.
    Regards

  • XML Structure Conversion using JAVA Mapping

    Hi Experts,
    I am having a requirement in which i want to convert the contents of source xml structure into a string and map it to the target field.
    Source Structure:
    <SRC>
    <Node1>ABCD</Node>
    <Node2>XYZ</Node2>
    <Node3>1234</Node>
    </SRC>
    Target Structure:
    <TRG>
    <Node1>ABCDXYZ</Node1>
    </TRG>
    Both the source and target structures are in xml format only.....just the condition is that I have to use Java mapping to achieve it.
    The contents of Source node Node3 are not to be mapped.
    Since I have very less knowledge of Java it will be very helpful if you provide the complete code to me.
    Thanks,
    Abhishek.

    Hello Udo,
    Thank you for reply. It seems ABAP mapping is easier.
    What do you think about the idea of using Value Mapping for such conversion task? In this case is it obligatory to use Java coding? And how about performance - will it be better than in case of ABAP mapping, can you say?
    Thank you,
    Igor

  • XML output as a string

    Hello
    I am having a XSLT where I am transforming multilevel source XML to a single level target XML. XSLT works fine from XSLTTester utility from SAP.
    The same XSLT I reused in XI and its working fine over there too.But the problem is the output XML what it generates is to be passed as a string to target application class.The target application takes entire XML structure as a string.
    Can anyone knows how this can be done from XI? In ABAP CALL TRANSFORMATION function takes XML string and returns transformed XML string.
    Thanks in advance.
    Regards
    Rajeev

    Hello
    My sender is an XML file which users can upload from a web-page i.e. HTTPSender to XI. This file gets transformed to target XML file using XSLT. My receiver system is SAP R/3 where there is a custom built application which already has got XML interface.This interface is a ABAP-class which has a method to parse the XML.
    This method accepts XML as a string and then creates necessary objects.What I am doing currently is building an RFC in which I am instantiating this class and trying to use the same method to create its object.
    So I want to convert the target XML as one string then my RFC would have only one importing parameter which is string which I could pass to the custom method.
    Do let me know if u have idea about this.
    Thanks in advance.
    Regards
    Rajeev

  • Mapping an XML structure into one field

    Make use of XSLT mapping (available on SDN...just search with CDATA...i think there is a new feature in PI7.1 (Copy XMl to subtree....something like that).
    Regards,
    Abhishek.

    Hi,
    Chk this:
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Re: Conversion of source XML structure to single string using PI 7.1
    Thanks
    Amit

  • XML structure - mapping one Oracle column to many XML attributes

    Hi,
    I need to insert data into EMP table reading from xml file and this is how the file would look like....
    <?xml version='1.0'?>
    <ROWSET>
    <ROW num="1">
    <EMPLOYEE_ID>7369</EMPLOYEE_ID>
    <LAST_NAME>Smith</LAST_NAME>
    <FIRST_NAME>JOHN</FIRST_NAME>
    <PHONE> 905000123</PHONE>
    <PHONE> 905000456</PHONE>
    <PHONE> 905000789</PHONE> ...... n
    (There could be many phone numbers in the xml file and I need to concatenate all the numbers and insert in the PHONE column of emp table)
    <SALARY>800</SALARY>
    </ROW>
    <!-- additional rows ... -->
    </ROWSET>
    I am new to XML and would to know the set of lines required to read the data from xml and insert into EMP table. All this is for Oracle 10g R2.
    Please let me know solution using XSU if possible.

    Hi,
    Chk this:
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Re: Conversion of source XML structure to single string using PI 7.1
    Thanks
    Amit

  • How to change  XML  Structure from one form to another form using OO ABAP.

    Hi Experts,
    In my Scenario, i need to do ABAP Mapping in order to change Incoming structure from one form to another.
    My Input to ABAP Mapping (OO ABAP Program)would be :
         <A>..........</A>
         <B>..........</B>
         <C> .........</C>
         <D>..........</D>
         <E>..........</E>
         <F>..........</F>
    OO ABAP Program need to read this input and change the XML Structure into below form:
         <A>..........</A>
         <B>..........</B>
         <C> .........</C>
          <X>
                <D>..........</D>
                <E>..........</E>
          <F>...............<F>
    Please provide inputs (sample Code) to solve this issue.
    Thanks,
    Kish.
    Edited by: Kishore Reddy Thamma on Jan 22, 2008 2:51 PM
    Edited by: Kishore Reddy Thamma on Jan 22, 2008 2:52 PM

    Hi,
    Please provide sample code or Material for converting XML Structure from one form to another using OO ABAP and
    Steps for ABAP MAPPING.
    Thanks,
    Kish.

  • Converting string data from a web service respons into XML structure of XI

    Hi,
    We receive a string structure from a web service.
    The string structure has an xml type format, that is all the tags and its content are in one line .
    The WSDL file of the webservice defines its response structure as a string type.
    How do i convert this string into proper XML structure (predefined by me in Integration repository).
    OR how do i make XI understand this string as an XML structure for further processing.
    Later i have to map this XML message type into IDoc.
    Himani

    Hi Himani,
    Please find the code for ur requirement -
    String need to parse -<response_webservice><from_date>20080101</from_date><to_date>20080202</to_date></response_webservice>
    Below mentioned code will convert it to -<MT_DATA><FROMDATE>20080202</FROMDATE><TODATE>20080101</TODATE></MT_DATA>
    Create a Message type and map it like this using java mapping ( no need to use Graphical mapping).
    Use MT_DATA as source and map it to your target structure .
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.StringReader;
    import java.util.HashMap;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.TransformerFactoryConfigurationError;
    import org.w3c.dom.DOMException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Text;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    public class XMLParser {
         private Map param = null;
         public static void main(String[] args) {
              try {
                   XMLParser wdb = new XMLParser();
                   wdb.parse();
              } catch (Exception e) {
                   e.printStackTrace();
         public void setParameter(Map param) {
              this.param = param;
              if (param == null) {
                   this.param = new HashMap();
         public void parse() {
              String document = "<response_webservice><from_date>20080101</from_date><to_date>20080202</to_date></response_webservice>";
              try {
                   Document sdoc;
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                   // Using factory get an instance of document builder
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   // parse using builder to get DOM representation of the XML file
                   sdoc = db.parse(new InputSource(new StringReader(document)));
                   Element docEle = sdoc.getDocumentElement();
                   NodeList nl = docEle.getElementsByTagName("from_date");
                   Element lstElmnt = (Element) nl.item(0);
                   NodeList nl1 = docEle.getElementsByTagName("to_date");
                   Element fstElmnt = (Element) nl1.item(0);
                   System.out.println(fstElmnt.getFirstChild().getNodeValue());
                   System.out.println(lstElmnt.getFirstChild().getNodeValue());
                   Document tdoc = db.newDocument();
                   Element structure = createElement("MT_DATA", null, tdoc);
                   tdoc.appendChild(structure);
                   Element statement = createElement("FROMDATE", fstElmnt.getFirstChild().getNodeValue(), tdoc);
                   structure.appendChild(statement);
                   Element statement2 = createElement("TODATE", lstElmnt.getFirstChild().getNodeValue(), tdoc);
                   structure.appendChild(statement2);
                   System.out.println("Struct is :::"+tdoc.getDocumentElement().toString());               
              } catch (DOMException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              }  catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (FactoryConfigurationError e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (ParserConfigurationException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (SAXException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (TransformerFactoryConfigurationError e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         static Element createElement(String elementName, String content,
                   Document document) {
              Element returnElement;
              returnElement = document.createElement(elementName);
              if (content != null) {
                   Text T = document.createTextNode(content);
                   returnElement.appendChild(T);
              return returnElement;
         static Element createElement(String elementName, String content,
                   String attributeName, String attributeValue, Document document) {
              Element returnElement = createElement(elementName, content, document);
              returnElement.setAttribute(attributeName, attributeValue);
              return returnElement;
    Regards,
    Kishore

  • XSLT Mapping to convert u201C.CSVu201D file into XML Structure.

    Hi All,
    I wanted to know can we use XSLT Mapping to convert u201C.CSVu201D file into XML Structure.
    I am communicating between two XI Systems. First XI system is going to give u201C.CSVu201D file as main document. I need to post IDOC Corresponding to this. So what I want to do is read this u201C.CSVu201D file (Main document in payload) and first convet it into XML and then use second mapping which will convert XML to IDOC.
    I know this is possible with JAVA Mapping but just wanted to confirm can we do this with XSLT mapping as well?
    Regards,
    Gouri

    Hi Amit,
    I know this way it shd work as i am able see other XSLT files. But this particular file is not visible.
    I am copying following code only in sample.xslt file.
    <xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fn="fn"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      version="2.0" exclude-result-prefixes="xs fn">
    <xsl:output indent="yes" encoding="US-ASCII" />
    <xsl:param name="pathToCSV" select="'file:///c:/csv.csv'" />
    <xsl:function name="fn:getTokens" as="xs:string+">
        <xsl:param name="str" as="xs:string" />
        <xsl:analyze-string select="concat($str, ',')" regex='(("["]*")+|[,]*),'>
            <xsl:matching-substring>
            <xsl:sequence select='replace(regex-group(1), "^""|""$|("")""", "$1")' />
            </xsl:matching-substring>
        </xsl:analyze-string>
    </xsl:function>
    <xsl:template match="/" name="main">
        <xsl:choose>
        <xsl:when test="unparsed-text-available($pathToCSV)">
            <xsl:variable name="csv" select="unparsed-text($pathToCSV)" />
            <xsl:variable name="lines" select="tokenize($csv, ' ')" as="xs:string+" />
            <xsl:variable name="elemNames" select="fn:getTokens($lines[1])" as="xs:string+" />
            <root>
            <xsl:for-each select="$lines[position() &gt; 1]">
                <row>
                <xsl:variable name="lineItems" select="fn:getTokens(.)" as="xs:string+" />
                <xsl:for-each select="$elemNames">
                    <xsl:variable name="pos" select="position()" />
                    <elem name="{.}">
                    <xsl:value-of select="$lineItems[$pos]" />
                    </elem>
                </xsl:for-each>
                </row>
            </xsl:for-each>
            </root>
        </xsl:when>
        <xsl:otherwise>
            <xsl:text>Cannot locate : </xsl:text><xsl:value-of select="$pathToCSV" />
        </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    Is this correct?
    -Gouri

  • Special characters in XML structure when prepared using String

    Hi,
       I am preparing an XML structure using 'String'. I print the prepared XML structure in the server log. Issue is that I am seeing extra characters([[ and ]]) that I am not printing.
    Please let me know how to get rid of those.
    Code Excerpt
            String xmlHeader = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
            String lsb_xmlcon = xmlHeader;
            logger.info("ReqXMLString Process  1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("<REQUEST>");
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.2  --->" + lsb_xmlcon);
    Log
    ReqXMLString Process  1  ---><?xml version="1.0" encoding="utf-8" ?>
    ReqXMLString Process  1.1  ---><?xml version="1.0" encoding="utf-8" ?>[[
    ReqXMLString Process  1.2  ---><?xml version="1.0" encoding="utf-8" ?>[[
    <REQUEST>
    Thanks,
    Message was edited by: 996913
    This issue is observed only while running the code in server, not from Jdev.
    When we append the additional tags without new line character, "\n", there are no extra characters being added. Also, in other case also. where we used "Marshaller" to prepare the XML, we have seen this issue.
    After we set the below property to false, we got rid of the extra characters.
                            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);
    Apparently the insertion of new line when the code runs on server(Weblogic 10.3.6.0) is creating the issue.
    Please let me know if anyone has come across a similar scenario.
    Thanks,

    I am building this XML in a servlet so ,right, DOM does process XML (even though a valid HTML file can be loaded into a DOM object) but if you build XML using DOM then write the XML out using PrintWriter and Transformer objects this will cause the XML to print out in your browser. If you view source on this XML you will see that the DOM object has translated all special characters to there &xxxx; equivalent. For a example: when the string (I know "cool" java) gets loaded into a attribute using the DOM object then wrote back out it looks like (I know &xxx;cool&xxx; java) if you view the source in your browser. This is what it should do, but the DOM object is not change the � to the "&xxxxx;". This servlet is acting as a gateway between a Java API and a windows asp. The asp will call the servlet expecting to get XML back and load it directly into a DOM object. When the windows DOM object gets the xml that I am returning in this servlet is throws a exception "invalid character" because the � was not translated to &xxxx; like the other characters were. According to the book HTML 4 in 24 hours (and other references) the eacute; or #233; are how you say "�" in HTML or XML. How do you say it?

Maybe you are looking for

  • My iphone 4 is broken can I get a replacement

    Hello Apple , My iPhone 4 is really in bad shape can I get a replacement even though I haven't paid my bill <Email Edited by Host>

  • Help with an ancient 760 model hard drive

    Here's the deal: A long time ago, in a galaxy far away, I was a high school student. At that time, my first laptop was a Thinkpad from the 760 series. After serving me valiantly into my first year of college, the laptop died. In the time I had the la

  • Speedgrade Crash upon start up

    Hello, everytime I send over a Premiere Pro sequence to Speedgrade, it crashes immediately. I have an HP Intel i7, 16 gigs ram, and an AMD Radeon HD 6450. Could someone give me any ideas why it would crash everytime? I just downloaded the trail Maste

  • External text dosn-t show Ş(S with cedilla) caracter

    external text file loaded in movie dosn't show Ş(S with cedilla) caracter, what should i do? if anyone can help please write to my e-mail [email protected]

  • Updating Library on iPod

    Hello All, I posted over at forums.macrumors.com and haven't had an answer yet and Googling is getting me nowhere. I thought I would post the issue here to see what might be done. I recently used my 60 GB 5th gen iPod to move a file from my Mac Mini