To convert  XML String- ResultSet

Hi
I am using Web Services created in EJB and will be accessed from JSP client containing applet-swing based GUI, using n tier architecture so I need to convert the XML String to Java ResultSet. (I am able to convert the ResultSet -> XML string using ResultSetBuilder), So I just want to know how to convet the XML String to Java ResultSet.
Secondly is there any method to manually add columns to the ResultSet.
Will anybody tell me of any utility, tools or the methods so that I can accomplish this task.
Thank in advance
nitin

What would be the point of doing this? A ResultSet is basically like a cursor running against a database query. You could create a fake ResultSet and pass it something else but why? Just use a normal data-structure.

Similar Messages

  • Special charecters handling while Converting XML string to DOM

    Hi,
    I am using the following approach for converting XML string to DOM, but due to Special characters like "&", I am getting Exceptions:
    String xmlString;
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(new InputSource(new StringReader(xmlString)));
    Can anyone please help me out on how to handle the Special characters in the above code.

    If the XML doesn't parse, then the XML must be invalid. Show a sample of such a special character in the XML data. Please use \ tags to post the actual XML content and any other code.                                                                                                                                                                                                                                                                                                                                                                                           

  • Convert XML string into XML

    Hi All,
    Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
    My XML string starts like this
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
       Thanks,
       Pavithra

    Thanks Praveen. It worked.
    However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
    <?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
    So there is an error in sxmb_moni. Is it possible to remove this.

  • Convert XML string into DOM

    Hi all,
    I have a question here regarding converting XML string into a DOM document.
    How can I do this in Java?
    The Document.Parse() methods do not have one that takes in String as its parameter.
    I'm not sure what is the best way to do this in Java.
    Any help is greatly appreciated.
    Thank you in advance.
    regards,
    Sean

    Convert XML String to Document with StringReader.
    String xmlString;
    DocumentBuilderFactory factory =
                DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
       Document         document = builder.parse(new InputSource(new StringReader(xmlString)));

  • Convert XML string into an abap format date and time

    Hi,
    Does anyone know of a method or a function module in ABAP which converts XML string into an abap format date and time.
    Here is a part of the xml that I want to convert.
    <ns2:EventDateTime>2009-07-02T10:13:45+10:00</ns2:EventDateTime>
    <ns2:EventMessageTransmissionDateTime>2009-07-02T10:13:45.987+10:00</ns2:EventMessageTransmissionDateTime>
    Currently EventDateTime and EventMessageTransmissionDateTime are type XSDDATETIME_Z and these are converted to proper dates and times. We will be changing these fields to a STRING instead of XSDDATETIME_Z. The reason for this is to make the field more versatile. The customer would be receiving dates with Zulu (2009-09-23T12:00:00Z), with offsets (2009-09-23T12:00:00+10:00/-10:00) and just local timestamp (2009-09-23T12:00:00). With this, we need to make the date fields as string
    to be able to accept the various date formats (esp. the local timestamp).
    I am looking for a standard function module or method that will convert the xml string to a proper date and time abap format.
    Would appreciate anyone's help!
    Thanks.
    Edited by: eunice ocson on Jul 13, 2009 1:49 AM
    Edited by: eunice ocson on Jul 13, 2009 1:50 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM

    Hi Eunice
    Use the FM 'SMUM_XML_PARSE'
    for more info
    [Convert XML string to ABAP|XML String to ABAP or GUI]
    hope it helps you.
    Thanks!!

  • XML: How to convert xml string into Node/Document

    I have a string in xml form.
    <name>
    <first/>
    <second/>
    </name>
    I want to convert this string into DOM Node or Document.
    How can I do this?
    Any help or pointer?
    TIA
    Sachin

    Try this :
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse(new org.xml.sax.InputSource(new StringReader(strXml)));Hope this helps.

  • Converting XML string to internal table

    Hello everyone,
    I am trying to convert an XML string to an internal table. The format of the XML string is as follows:
    <node label="Compressors" NODE_ID="783" checked="1" expandStatus="false">
       <node label="Nail guns" NODE_ID="78543" checked="1" expandStatus="false"/>
       <node label="Spray guns" NODE_ID="855" checked="0" expandStatus="false"/>
       <node label="Cleaning equipment" NODE_ID="9" checked="1" expandStatus="false"/>
    </node>
    What I need is an internal table with the fields NODE_ID and checked filled. The hierarchy here doesn't matter, so I just need an internal table of a structure with 2 fields. The whole XML is hierarchical and contains only the <node> tag, which can be self-closing or not with the attributes within the tag.
    What is the best way to accomplish this?
    Performance here is quite important too, as this XML can contain over 100,000 nodes.
    Should it be done with an xpath expression, with a regex, with the iXML parser, an XSLT call transformation?
    Any help is greatly appreciated!
    Best regards,
    Vincent

    Use this FM to get into internal table
                CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
                  EXPORTING
                    im_xstring = zl_attcntx
                  IMPORTING
                    ex_string  = zl_attcont.
       SPLIT zl_attcont AT cl_abap_char_utilities=>newline INTO TABLE zit_legacy.

  • Converting XML string to ABAP types

    Hello,
    I am having a requirement where i wanted to parse incoming XML string and i checked few of examples of CALL TRANSFORMATION id.
    but whatever examples i checked those were simple transformation with no hierarchy.
    My source structure
    <record>
    <firstname>XYZ</firstname>
    <position>Testposition</postion>
    </record>
    and i used
    CALL transformation id
    source xml lv_xml
    result firstname = lv_firstname position = lv_position.
    but lv_firstname and lv_position were blank. any idea whether it can be acheived through such method?
    thanks in advance.
    regards
    rajeev

    Hello Rajeev,
    Try using the following simple transformation
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="record"/>
      <tt:template name="record">
        <record>
          <firstname>
            <tt:value ref="record.firstname"/>
          </firstname>
          <position>
            <tt:value ref="record.position"/>
          </position>
        </record>
      </tt:template>
    </tt:transform>
    In your code you could define a structure like the following:
    TYPES: BEGIN OF record,
                  firstname TYPE char50,
                  position  TYPE char50,
                END OF record.
    And now you could use the CALL TRANSFORMATION in your code to convert the xml string into the structure and visa-versa.
    CALL TRANSFORMATION zcl_test_rec
          SOURCE XML lv_string
          RESULT record = ls_test.
    Where lv_string holds the xml as a string and ls_test is defined as a structure of type record (defined above).
    Hope this helps.
    Thank you,
    Ramneek

  • Converting XML String to MessageElement array

    Hi,
    I am trying to call a .NET web service from my Java client. I used WSDL2Java to generate the java classes for calling the .NET web service. The generated classes to call the service expects an array of org.apache.axis.message.MessageElement objects. I have a string representing an XML document which looks like this:
    String xmlString = "<Results><Adjustments><Adjustment><RebuildAdjustmentID>16</RebuildAdjustmentID><IsBasicAdjustment>true</IsBasicAdjustment><AdjustmentType>stone/AdjustmentType><Title>External walls</Title></Adjustment></Adjustments></Results>"
    I have tried converting the string into an array of MessageElement objects by the following way:
    MessageElement[] m = new MessageElement[1];
    Document XMLDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(result2.toString())));
    m[0] = XMLDoc.getDocumentElement();
    However I keep getting the following message returned from the service:
    "Object reference not set to an instance of an object"
    I have tried a handful of ways but keep getting this same error. I have searched the web for hours looking for a solution to this problem without success so any help/ideas much appreciated,
    Thanks.
    Paul

    Any updates on this?
    I am facing a similar problem.

  • Convert xml string into xml file?

    Hi,
    I got a method that returns an JDom Element object.
    Then I use the JDOM Element toString method() to change it into xml string.
    Now, I need to convert it into actual xml file.
    How to I do it?
    Thanks.

    Hi,
    If you got an xml string, just write it to an ordinary file. Look at FileWriter.
    /Kaj

  • How to convert xml String to xml file?

    Hi,
    I got a method that do the following:
    public static String convertXmlToString(String xmlFileName) throws Exception
            File file = new File(xmlFileName);
            FileInputStream insr = new FileInputStream(file);
            byte[] fileBuffer = new byte[(int)file.length()];
            insr.read(fileBuffer);
            insr.close();
            return new String(fileBuffer);
         }The return String is the contents of an existing xml file and one example is shown below:
    <object type="server.WOXReference" id="0"><field name="actualPathObj"><object type="java.lang.String" id="1">C:\restClient\actualXMLObjects\812856084.xml</object></field><field name="object"><object type="server.WOXConstructor" id="2"><field name="className"><object type="java.lang.String" id="3">rec.SimpleRecognizer</object></field><field name="types"><array type="java.lang.String" length="3" id="4"><object type="java.lang.String" id="5">double[].class</object><object type="java.lang.String" id="6">double.class</object><object idref="6" /></array></field><field name="args"><array type="java.lang.Object" length="3" id="7"><array type="double" length="5" id="8">22.33 33.22 33.33 22.0 11.0</array><object type="java.lang.Double" id="9">2.2</object><object type="java.lang.Double" id="10">3.3</object></array></field><field name="retType"><object type="java.lang.String" id="11">act</object></field></object></field></object>
    and I want to change the above string to xml file like below:
    <object type="server.WOXReference" id="0"><field name="actualPathObj"><object type="java.lang.String" id="1">C:\restClient\actualXMLObjects\812856084.xml</object></field><field name="object"><object type="server.WOXConstructor" id="2"><field name="className"><object type="java.lang.String" id="3">rec.SimpleRecognizer</object></field><field name="types"><array type="java.lang.String" length="3" id="4"><object type="java.lang.String" id="5">double[].class</object><object type="java.lang.String" id="6">double.class</object><object idref="6" /></array></field><field name="args"><array type="java.lang.Object" length="3" id="7"><array type="double" length="5" id="8">22.33 33.22 33.33 22.0 11.0</array><object type="java.lang.Double" id="9">2.2</object><object type="java.lang.Double" id="10">3.3</object></array></field><field name="retType"><object type="java.lang.String" id="11">act</object></field></object></field></object>How to I change the above xml String back to xml file again? The appropriate tags must be taken care of like > must be > and < must be <.
    Please advice and can give me some sample code.
    Thanks.

    By writing some code that runs through the file and adds a new line for a new element using these methods here...
    http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/ContentHandler.html
    i.e.
    startDocument()
    startElement(String namespaceURI, String localName, String qName, Attributes atts)
    endDocument()

  • Converting XML string to Element Type

    Im receiving an XML document as a String.
    I have defined an element whose message type is of the same schema as the XML String.
    How can i assign this string to this element in BPEL?
    im using the setVariable function as follows:
    setVariableData("Customer","CustomerType", new String(received))
    It does not throw an error. But im unable to retrieve any of the values from this element.
    Could someone pls help me with this?

    The output seems to be fine and structured in the XML Format, when i pass the string to the Message Type(ie CustomerType) rather than the root node (CustomerElement).
    eg: in this case i have
    Customer - > CustomerType -> CustomerElement - > Name, date etc...
    When i assign the string to Customer Element, it displays it as a string.
    When i assign the string to CustomerType it displays it in the XML Structure.
    It however throws an error when i assign an element in the data to something.

  • Convert XML-String from Codepage utf-16 to ISO-8859-1

    Hi to all experts,
    our system is now unicode with codepage 4102 (UTF-16) and we do an Simple Transformation for creating an XML-String.
    before UniCode : xml_data = <?xml version="1.0" encoding="iso-8859-1"?>#<transactionRequest userID=" .......
    now with UniCode : xml_data = <?xml version="1.0" encoding="utf-16"?>#<transactionRequest userID=".......
    The xml_data transfered to an external Sytem via HTTPS- Communication direct from ABAP.
    The external Sytem send an Error Request:
    <?xml version="1.0" encoding="ISO-8859-1"?>#<transactionResponse>#    <transactionErrorResponse>#        <errorResponse>#            <errorCode>SYS-0001</errorCode>#            <errorDescription>java.lang.Exception: null[ #<?xml version="1.................
    Have you any idea
    Thanks for your help!
    Peter
    Edited by: Peter Pforr on Sep 25, 2008 9:59 AM
    Edited by: Peter Pforr on Sep 25, 2008 10:14 AM

    Darshan,
    Did you get an answer for this question? We have same requirement to create XML file in ISO-8859-1 format with Attributes is set to "Y" and CDATA is being used for data.
    Can you please let me know if you still remember how did you achieve it?
    Satyen...

  • Converting xml string to valid xml format In biztalk expression shape

    <DocumentElement>
    <ApplicationStatus>
    <ApplicationName>XpathDebatch</ApplicationName>
    <Status>Stopped</Status>
    <ReceivePorts>RcvRates, </ReceivePorts>
    <Sendports>SendRates, </Sendports>
    <Orchestration>xpathDebatch.BizTalk_Orchestration1,</Orchestration>
    </ApplicationStatus>
    </DocumentElement>
    <DocumentElement>
    <ApplicationStatus>
    <ApplicationName>SendingSMTPEmail</ApplicationName>
    <Status>Stopped</Status>
    <ReceivePorts>SendingSMTPEmail_1.0.0.0_SendingSMTPEmail.Process_SendSMTPEMail_Port_RcvInputMsg_6d1bf831128e1b5e, </ReceivePorts>
    <Sendports>SendingSMTPEmail_1.0.0.0_SendingSMTPEmail.Process_SendSMTPEMail_Port_SendSMTPMail_6d1bf831128e1b5e, </Sendports>
    <Orchestration>SendingSMTPEmail.Process_SendSMTPEMail,</Orchestration>
    <Pipeline>SendingSMTPEmail.SP_SendSMTPEMail</Pipeline>
    </ApplicationStatus>
    </DocumentElement>
    <DocumentElement>
    <ApplicationStatus>
    <ApplicationName>OracleTest</ApplicationName>
    <Status>Stopped</Status>
    <ReceivePorts>RcvFromOracle, </ReceivePorts>
    <Sendports>SendToFolder, </Sendports>
    </ApplicationStatus>
    </DocumentElement>
    <DocumentElement>
    Hello all,
    I am getting an string(variable)  like I  shown above, I want to convert that to Proper Xml Format in
    Expression shape itself (<root>Data</root>)
    so that I can Load it to xml and send it to Local Folder.
    Thanks

    Hi
    NILESH_AES,
    Based on your title, your case related to BizTalk. I will move your thread to
    BizTalk Server > BizTalk Server General
     forum for better support.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Xml string  to internal table = change  utf-8 to utf-16

    Hello Experts,
    I have a requirement to convert XML String to abap intrnal table .
    I have to get an xml file from application server using opendataset as
    ?<?xml version="1.0" encoding="utf-16" standalone=
    "yes"?><WPUBON01>## <IDOC BEGIN="1">## <EDI_DC
    40 SEGMENT="1">##
    while I am getting as
    <?xml version="1.0" standalone="yes"?>
    <WPUBON01>
    <IDOC BEGIN="1">
    Please advice how I can change the encoding to UTF-16 .
    sun

    Hello Experts,
    I have a requirement to convert XML String to abap intrnal table .
    I have to get an xml file from application server using opendataset as
    ?<?xml version="1.0" encoding="utf-16" standalone=
    "yes"?><WPUBON01>## <IDOC BEGIN="1">## <EDI_DC
    40 SEGMENT="1">##
    while I am getting as
    <?xml version="1.0" standalone="yes"?>
    <WPUBON01>
    <IDOC BEGIN="1">
    Please advice how I can change the encoding to UTF-16 .
    sun

Maybe you are looking for

  • Can I install Windows XP on a new macbook with lion preinstalled?

    I have a fully licensed version of windows XP that I used for snow leopard, but bootcamp on my new macbook air only recognizes windows 7. A) can I install XP and skip 7? How? B) if not, can I buy a windows 7 upgrade and somehow use my licenced XP as

  • Logoff button is not working for end user application

    Hi Team , Enterprise Portal : SAP Netweaver 7.0 We have updated Support pack from SP11 to SP21. and in End user application log-off tab is not working. ALthough when we login through Administrator user it is working  fine Regards, Kamal

  • Me2n & me2m & me2l reports in service po

    Dear gurus, I am not getting the proper out put in me2n, me2m & me2l reports of service po. For materials PO I am getting the proper reports, but while executting the above T-code for service PO, it is not showimg me the proper output report. In serv

  • Migrating 10g report to Bi Publisher 11g

    Hello, I have an existing 10g report from BI Publisher. I would like to upgrade to 11g. in that process, i created a folder in 11g, with catalog menu option. But when i try to upload existing datamodel from 10g, my upload fails. Can any one advise on

  • ITunes does not open preferences and stops responding

    Hi! Whenever I open iTunes, it works fine but whenever I plug in my iPad, it stops responding. I read online that I have to go into preferences and some other stuff to fix it but when I try to go into preferences, it stops responding and doesn't come