How to retreive the modified XML data?

Hi..
i had a problem in retrieving the modified xml data.
Iam using apache's DOMParser
In the my class my xml data is stored in a string.so i used following statement to read xml data from that string:
String abc="<? xml version=... some data goes here"
InputSource in=new InputSource(new ByteArrayInputStream(abc.getBytes()));
          DOMParser domParser = new DOMParser();
          domParser.parse(in);
          Document doc = domParser.getDocument();
          Element root = doc.getDocumentElement();
and i did some operations like adding ,removing and replacing elements etc.
It was fine when the checked the data.
but..i need my modified xml data as String.
is there any method to retrieve the modified xml data "as it is" in String?

You can use XMLSerializer.
Here is an example that dump your document on the console:
OutputFormat formatter = new OutputFormat();
formatter.setPreserveSpace(true);
XMLSerializer serializer =
new XMLSerializer(System.out, formatter);
serializer.serialize(doc);
where doc is your Document.

Similar Messages

  • How to populate the webservice XML data in to Table  ODI- Webserice invoke

    Hi,
    I have multiple work orders in my oracle db table, That means multiple WorkOrder_Item_ID's are there in my source table. When I start transfer the data from source to Target using ODI , I need to get the information of multiple Work order Item_IDs from the Webservice response data ( XML data) of another system by calling ODI Webservice Invoke in ODI and insert the same Webservice XML response data in my source table in the corresponding Item_ID's.
    My First question : How can I take the data from Webservice XML and put in to correspoding Item relevent data in to Source Table
    Second question: How can I send the multiple work order item ID at the same time to the Webservice and insert the relevant item data in to Source table using ODI.
    Finally this combined soure table data should be moved to Target table in ODI.. That I know.. How to do it.
    Can any one please give answers for the above said two questions.
    Thanks,
    Rajesh
    Edited by: user11226287 on Oct 30, 2009 4:40 AM
    Edited by: user11226287 on Nov 1, 2009 10:44 PM
    Edited by: user11226287 on Nov 1, 2009 10:59 PM

    I find some words in the implementation guide, it says:"To collect data from your non-Oracle ERP systems or your trading partners' systems,you model each non-Oracle ERP system or trading partner as an Oracle Applications organization and store their setup and transaction data there".
    But I can't find where to model the application organization for the legacy system.
    anyone can give some clues? Thanks in advance.

  • LabVIEW webservice: How to format the published XML data

    Hi,
    Im trying to  publish some measurement data with LabVIEW webservice and read the data with Android client. However i have some problems with the XML output from the LabVIEW webservice.
    I want to publish the data in in this form:
    <Response>
     -<Terminal>
            <Parameter> Temperature</Parameter>
             <Value> 5 </Value>
            <Unit> ºC </Unit>
           <Description> Measurements from Sensor 1</Description>
       </Terminal>
    </Response>
    Any ideas how i can do this? i havent found any good example on how to format the XML output this way. 

    Hi,
    You can format the data using Format Into String as shown in the attached snippet. Is this maybe something you can use?
    Willy
    Willy
    Attachments:
    format xml data.png ‏31 KB

  • How to access the following xml data in Flex

    <users>
    <user dept id="HR">
         <user>
              <fname>mm</fname>
              <email>[email protected]</email>
         </user>
         <user>
              <fname>sss</fname>
              <email>[email protected]</email>
         </user>
    </dept>
    <user dept id="Finance">
         <user>
              <fname>ffff</fname>
              <email>[email protected]</email>
         </user>
         <user>
              <fname>www</fname>
              <email>[email protected]</email>
         </user>
    </dept>
    </users>
    using HTTP service through access the data
    this my user.xml file i want to display all the item in flex datagrid using tab navigator function................ each tab navigator contain one data grid for corresponding Dept like HR, sales , Finance
    corresponding information will display in data grid
    first tab navigatore is
    HR ->  data grid field like fname , Email
    finance -> fname, E Mail

    great for quick reply
    my XML file is data.xml
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    private var myUser:XML =
    <users>
    <dept id="hr">
        <user>
            <firstName>murali</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>bharathi</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>vasa</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    <dept id = "finance">
        <user>
            <firstName>mohan</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>vinoth</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    <dept ="sales">
        <user>
            <firstName>manoj</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>deepan</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    </users>
    codings i used
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute" creationComplete="htp.send()">
        <mx:HTTPService id="htp" url="data.xml"
            result="resulthandler(event)"
            fault="faulthandler(event)"/>
            <mx:Script>
                <![CDATA[
                    import mx.collections.ArrayCollection;
                    import mx.rpc.events.FaultEvent;
                    import mx.rpc.events.ResultEvent;
                    [Bindable] private var userlist:ArrayCollection;
                    private function resulthandler(event:ResultEvent):void
                        userlist=(htp.lastResult.user.dept.user);
                    private function faulthandler(event:FaultEvent):void
                ]]>
            </mx:Script>
            <mx:TabNavigator>
            <mx:Repeater id="rep" dataProvider="{data.dept}"> <!--data.xml is my fle name-->
                <mx:Canvas label="{rep.currentItem.@id}">
                    <mx:DataGrid dataProvider="{rep.currentItem.user}">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Name" dataField="fname"/>
                            <mx:DataGridColumn headerText="E Mail" dataField="email"/>
                        </mx:columns>
                    </mx:DataGrid>
                </mx:Canvas>      
            </mx:Repeater>
    </mx:TabNavigator>
    </mx:Application>
    its not show anything

  • How to autofill the Modified Date And Modified User?

    hi All,
    Below is the screenshot of my form , if we look at the last 4 columns we have Created Date,Created User Id which is popped up automatically if a new entry is being created. Now if we look at the last 2 ModifiedDate and ModifiedUserId those fileds will be
    empty wile creating a new entry which is good for me. But lets say if i go back to any existing record and want to modify it then the modified date and modified userid must be popped up with that persons name and current date. I think i can use the logic i
    have to get date and userid but i want some help with code to how to make the modified fields fill up.
    Can someone please help me with this?
    Thanks a lot for all your time and support.

    well I use it all the time, and have no problem in that initially both the 'started' and the 'modified' date fields have the same value..... because when one is editing a record whether initially putting in data or adding/changing later - they are both considered
    to put the form in a dirty state.
    then in future edits only the modified date field changes.  the code in the OnDirty event is:
    me.ModifiedDateFieldName=Now()
    any other approach will be more difficult to achieve as essentially one must trigger it not universally at the OnDirty event but something more specific such as at every control

  • How do you store parsed XML data in an array

    Hi, i am trying to complete a small program which implements the SAX parser to parse an XML file. My problem is that i am writing a custom class to store the parsed data into an array, and then make the array available to the main program via a simple method which returns the array. I know this must be very simple to do, but i seem to have developed a mental block with this part of the program. I can parse the data and print all the elements to the screen, but i just cant figure out how to store all the data elements into the array. I will post the class which is supposed to do this, and ask anyone out there if they know what i'm doing wrong, and also, if there is a more effeicient way of achieving this ( i expect there definitely is!! but i have never used the SAX parser before and am getting confused by the API docs on it!!) Any help very much appreciated.
    Here is my attempt at coding the class to handle the parsed XML data
    class Sink extends org.xml.sax.helpers.DefaultHandler
         implements org.xml.sax.ContentHandler{
    Customer[] customers = new Customer[20];
         int count = 1;
         int x = 0;
         int tagCount = 0;
         String name;
    String custID;
         String username;
         String address;
         String phoneNum;
    public void startElement(String uri, String localName, String rawName, final org.xml.sax.Attributes attributes)throws org.xml.sax.SAXException{
    //count the number of <name> tags in the XML file
         if(rawName.equals("name")){
              tagCount++;
    public void characters(char[] ch, int start, int len){
    //get the current string
         String text = new String(ch, start, len);
         String text1 = text.trim();
    //there are 5 elements for each customer found in the XML file so when the count reaches 6
    // i reset this to 1
         if(count == 6){
         count = count - 5;
         if(text1.length()>0 && count == 1){
              name = text1;
              System.out.println(name);
              }else{
         if(text1.length()>0 && count == 2){
              custID = text1;
              System.out.println(custID);
                   }else{
                   if(text1.length()>0 && count == 3){
                   username = text1;
                   System.out.println(username);
                   }else{
                        if(text1.length()>0 && count == 4){
                        address = text1;
                        System.out.println(address);
                        }else{
                        if(text1.length()>0 && count == 5){
                             phoneNum = text1;
                             System.out.println(phoneNum);
                             //add data to the customer array
                             customers[x] = new Customer(name, custID, username, address, phoneNum);
    // increment the array index counter
                        x = x+1;
                        }//end of if
                        }//end else
                        }//end else
                   }//end else
              }//end else
    }//end of characters method
    public void endDocument(){
         System.out.println("There are " + tagCount +
         " <name> elements.");
    }//end of class Sink
    Before the end of this class i also need to make the array available to the calling program!!
    Any help would be much appreciated
    Thanks
    Iain

    Ok, yer going about this all the wrong way. You shouldn't have to maintain a count of all the elements. Basically you are locking yourself into the XML tags not only all being there but are assuming they are all in the same order. What you should do is in your characters() method, put all of the characters into a string buffer. Then, in endElement() (which you dont use btw, you should) you grab the information that is in the string buffer and store it into your Customer object depending on what the tagName is.
    Also, you should probably use a List to store all the Customer objects and not an single array, it's more dynamic and you arent locked into a set number of Customers.
    I wont do it all for you, but I'll give you a good outline to use.
    public class CustomerHandler extends DefaultHandler {
        private java.util.List customerList;  // List of Customer objects
        private java.util.StringBuffer buf;   // StringBuffer to store the string of characters between the start and end tags
        private Customer customer;  // Customer object that is initialized with each entry.
        public CustomerHandler() {
            customerList = new java.util.ArrayList();   // Initialize the List
            buf = new java.util.StringBuffer();   // Initialize the string buffer
        //  Make your customer list available to other classes
        public java.util.List getCustomerList() {
            return customerList;
        public void startElement(String nsURI, String sName, String tagName, Attributes attributes) throws SAXException {
            // Clear the String Buffer
            //  If the tagName is "Customer" then create a new Customer object
        public void characters(char[] ch, int start, int length) {
            //  append the characters into the string buffer
        public void endElement(String nsURI, String sName, String tagName) throws SAXException {
            // If the tagName is "Customer" add your customer object to the List
            // Place the data from the String Buffer into a String
            //  Depending on the tagName, call the appropriate set method on your customer object
    }

  • How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection

    How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection.
    I have a multiple rows on PDF form. All rows have 4 textfields. I want to submit the multiple rows data to a method defiened in webservice.
    Unable to retrieve the data in multiple rows within webservice method.

    Hi Paul,
    I'm now able to save the retrieved xml in a hidden text field and create dynamic table, and I'm able to fill this table from the XML, but the problem is that I could not find the correct way to loop on the xml, what I'm trying to say, the table will have number of rows with the data of the first row only, so can you tell me the right way to loop on the xml!
    this is my code
    TextField1.rawValue=xmlData.document.rawValue;
    xfa.datasets.data.loadXML(TextField1.rawValue, true, false);
    for(var i=0; i<count; i++)
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Num").rawValue = xfa.datasets.data.record.num.value;
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Name").rawValue = xfa.datasets.data.record.name.value;
    Table1.Row1.instanceManager.addInstance(true);
    Thanks
    Hussam

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

  • HOW TO FIND THE REQUIRED DELIVERY DATE IN VA02

    hi
    HOW TO FIND THE REQUIRED DELIVERY DATE IN VA02.
    i want to display this field in my report. what is the fieldname and in which table it is ?

    Hi Jyothsna,
    There are 2 dates when you say Requested Delivery Date
    1.  Header level in VBAK-VDATU is the field
    2.  At item level it is in the schedule line. VBEP-EDATU.
    The relationship between item (VBAP ) and schedule line ( VBEP )is 1 to many. But there will be mutiple schedule lines only if you are using the scheduling functionality. Also note to check for confirmed quantity (VBEP-BMENG) to be greater than 0 and use that schedule lines EDATU date as Requested delivery date.
    regards,
    Advait Gode.

  • How to use the validation.xml in struts validation?

    Can any one please help me, how to use the validation.xml in struts validation? possible please give me simple example.
    Edited by: SathishkumarAyyavoo on Jan 31, 2009 12:03 PM

    These 2 are the good articles for the beginners to do validation things in Struts. you can follow any one of them.
    1. [http://viralpatel.net/blogs/2009/01/struts-validation-framework-tutorial-example-validator-struts-validation-form-validation.html]
    2. [http://www.vaannila.com/struts/struts-example/struts-custom-validation-example-1.html]
    All the best.

  • How to maintain the material master data in plant

    Hi all,
    while creating BOM I am getting an error "no material master data in plant' can some one help me how to maintain the material master data in plant
    Regards,
    Balu

    Check the material available in MARC table in SE11 transaction against your plant.If it is not available please maintain through MM01 transaction.

  • How to export the text edit data to excel file without splitting the data in excel file?

    how to export the text edit data to excel file without splitting the data in excel file?
    I have a requirement in SAP HR where in the appraiser can add comments in the area given and can export that to excel file. Currently the file is getting exported but the comments getting split into deifferent rows.
    I want the entire comment to be fit in one row.
    Please help.
    Thank you

    Hi,
    if your text edit value is stored in 'lv_string' variable.
    then before exporting the value to excel you have to remove CL_ABAP_CHAR_UTILITIES=>NEWLINE
    that is '#' from the variable lv_string.
    for that use code some thing like this.
    REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>NEWLINE in lv_string WITH space.
    I think this will do the trick.

  • How to track the flow of data from R/2 to BI ?

    Hi Experts,
    Question: How to track the flow of data from R/3 to BI ?
    I want to load master data from R/3 to BI. In BI, i create an infopackage to load data from R/3. Under processing tab i set it as "PSA and then in the InfoObject (package by package)". Its a Full update.
    Now, i start the update to InfoObject. The load goes on well.
    Now, i want to track the flow of data from the master data table in R/3 to Datasource in R/3 then Extractors and then in the PSA in BI and then till the InfoObject. That is the complete flow of data from source table (in R/3) to Target table (in BI).
    Please help me know how this can be done. (For example lets take cost element master data)
    Regards,
    Suraj S Nair

    Hi,
    Data flow :
    BW :
    When u right click on the Master Data Info object -> Select Data flow.Then  it will  show u the details like DS name,IS (If 3.x)
    Once u know the DS then you need to find out the source tables for the R/3 DS.This information will get using ROOSOURCE or ROOSFIELD tables  or help.sap.com.
    My suggestion better to search in Help site for DS source tables.
    DS Tables :
    The following link will provide you the source tables for some of the LO DS.
    https://wiki.sdn.sap.com/wiki/display/BI/BWSDMMFIDATASOURCES
    Regards
    Ram.
    Edited by: Ramakanth Deepak Gandepalli on Dec 22, 2009 9:29 AM

  • How to store the flat file data into custom table?

    Hi,
    Iam working on inbound interface.Can any one tell me how to store the flat file data into custom table?what is the procedure?
    Regards,
    Sujan

    Hie
    u can use function
    F4_FILENAME
    to pick the file from front-end or location.
    then use function
    WS_UPLOAD
    to upload into
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'   "Function to pick file
        EXPORTING
          field_name = 'p_file'     "file
        IMPORTING
          file_name  = p_file.     "file
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                       = p_file1
        TABLES
          data_tab                      = it_line
    *then loop at it_line splitting it into the fields of your custom table.
    loop at it_line.
              split itline at ',' into
              itab-name
              itab-surname.
    endloop.
    then u can insert the values into yo table from the itab work area.
    regards
    Isaac Prince

  • How to config the web.xml file, when I use Richfaces + RI 1.2?

    Hi there:
    I want to use Richfaces + RI 1.2 to build a project. I don`t know how to config the web.xml file.
    By the way, my web server is Tomcat 6.0, my JDK's version is 6u6. I don`t want to use the facelets.
    thanks.
    lxm

    just add this before *</web-app>*
    <context-param>
           <param-name>org.richfaces.SKIN</param-name>
           <param-value>blueSky</param-value>
      </context-param>
      <filter>
           <display-name>RichFaces Filter</display-name>
           <filter-name>richfaces</filter-name>
           <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
           <filter-name>richfaces</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
           <dispatcher>REQUEST</dispatcher>
           <dispatcher>FORWARD</dispatcher>
           <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

Maybe you are looking for

  • Payload is missing in XI adaptor

    HI My scenario is file->XI->Proxy. Message is showing sucessful in SXMB_MONI,but the output message in payload of XI adaptor is not comming.Under  the SOAP Ody only maifest exists,ut no payload can be seen.Also in proxy input structure data is not co

  • Is there a bug in Automator filter finder items?

    I'm trying to do a batch processing script and there seems to be a bug with items created earlier in the script.  For example, the 2brokegirls.jpg file was created earlier in the script and added to the main folder whose contents can be seen in the g

  • Handsoff : distincts ringtones if self-created ringtone on iPhone-

    Hi, on my iPhone I have set a ringtone that doesn't come from Apple. I created it the way it should and imported it in the iPhone with iTunes. It works well. But when my iDevice is near my MacBook Pro, the ringtone coming from my Mac isn't the same t

  • Join this two table HELP

    Hi to all.. i have this two table , the problem is i dunno how to join this two table into one, becoz in the forms i have two button "BUTTON A IS FOR TABLE A WHICH IS THE EMPLOYEE.. AND BUTTON B IS FOR ADMIN... WHAT I WANT IS TO MAKE THIS TWO BUTTON

  • Kodak Zi6 and Premiere Elements?

    I tried to import HD video from a Kodak Zi6 into Premiere Elements 3 and it wouldn't take it.  Will Version 7 accept it?  Has anyone tried it? If I try to convert it to a format that Version 3 will take, will it degrade the HD quality?