How to get  xml Element , data and its Childs

hi,
I am trying to get entire Element and its childs depending on condition.
suppose
   if(doc.element.name== "despatch"){
               // here i want entire despatch element with data and childs and copy into one string like
               // eg: String dsp = <despatch><name>body1</name> <value>value1<value>
</despatch>
<?xml version="1.0">
<handler>
     <name>header1</name>
     <value>value1</value>
</handler>
<despatch>
     <name>body1</name>
     <value>value1<value>
</despatch>
<gov>
     <name>env</name>
     <value>value1</value>
</gov>I managed to get number of elements depending on the Element name but i need to get the entire block.
nodeList = document.getElementsByTagName("despatch").item(0).getChildNodes();
                    for(int i=0;i<nodeList.getLength();i++){
                         System.out.println("i :"+document.getElementsByTagName("m:Security").item(i));
                    }any kind of help is appreciated.
Han.
Edited by: HANRAM on Apr 24, 2008 2:48 AM

Hi Kartik,
This one is similar to my question to print and email invoice at same time.  I pass itcpo-tdgetotf = 'X' in order to get otfdata and send email with the attachment of otfdata.
Now I have data in otfdata, but when I call print_otf function, I clear out itcpo-tdgetotf, and passed
itcpo-tddest = device_type but I still get error message said 'Handler not valid for open spool request'.
Can you give me a working example that you have otfdata table and print data from that table.  I also post my question on other thread
submit report and export to memory
thanks

Similar Messages

  • How to get both OTF data and spool at a time

    Hi Experts,
        My requirement is to get both OTF data and spool.
    In 'OPEN_FORM' i tried passing itcpo-TDGETOTF = 'X'. itcpo- TDNEWID = 'X'.
    I was able to get OTF data but spool is not getting generated.
    IF i pass only itcpo- TDNEWID = 'X'. the spool is getting generated but not OTF data.
    when both the fields are set i.e. itcpo-TDGETOTF = 'X'. itcpo- TDNEWID = 'X'.
    the spool is generation is getting supressed.
    Similarly when i tried to get OTF data by passing itcpo-TDGETOTF = 'X'. to 'OPEN_FORM' as i need to convert it to PDF and send it to vendors as email ,
    The print preview in TCODE ME23n was not getting generated for 'MESSAGE' option 'External send'.
    Please suggest me how to get both OTF data and spool at a time.

    Hi Kartik,
    This one is similar to my question to print and email invoice at same time.  I pass itcpo-tdgetotf = 'X' in order to get otfdata and send email with the attachment of otfdata.
    Now I have data in otfdata, but when I call print_otf function, I clear out itcpo-tdgetotf, and passed
    itcpo-tddest = device_type but I still get error message said 'Handler not valid for open spool request'.
    Can you give me a working example that you have otfdata table and print data from that table.  I also post my question on other thread
    submit report and export to memory
    thanks

  • How to get Portal Login User and Its Related BP in CRM?

    Hi,
    An ABAP Webdynpro program is called in CRM from Portal user by a portal link. How to get the user ID and its related BP in CRM? Thanks!
    The portal is integrated with ECC, and all users and BPs are maintained in ECC then replicated to CRM.
    Best regards,
    Hao

    Hi,
    Try the below code
    IUserFactory userfact=UMFactory.getUserFactory();
    IUser user=userfact.getUserByUniqueName(request.getUser().getUserId());
    String usrid=user.getUniqueName();
    And also you can get the groups assigned to user by using the below code
    Iterator groups = user.getParentGroups(true);
    while (groups.hasNext()) {
         String groupstr = (String) groups.next();
         IGroup g = UMFactory.getGroupFactory().getGroup(groupstr);
         response.write("Group name "g.getUniqueName()"<br>");
    Regards
    Suresh

  • How to get the client date and time ?

    Dear Sirs...
    Using jdeveloper 10.1.2.0
    How can i get the client date and time using the HttpServletRequest ?
    thanks for any help in advance
    best regards

    If your code is running on the client pc you can just create a new instance of the java.util.Date class. That class automatically defaults to the current time of the client machine. Otherwise if you're running the code on the server, you could insert/post the client date/time by adding its string representation as a parameter to the HTTP request object.
    Ronald

  • How to get last modified date and time of a file which is in apache server.

    Hi ,
    I need to get last modified date and time of a file in remote machine.
    This file is in remote machine which has apache server installed.
    I am trying to get this information by connecting to apache server from client by giving absolute URI of the file to file object.
    URI is got from apache server URL by using toURI method.
    when I use lastModified method , its throwing exception , because scheme of URI is not file.
    I can't give scheme as file because ftp server is not installed on that server
    Is there any other way to get this information .

    No, unless you can use an FTP client.

  • How to edit XML parsed data and save on iPhone app

    Hi,
    How to edit and XML retrieved data that is displayed on an iPhone app and save again in the same XML file using iPhone SDK.
    In other words I want to change the XML file data or edit and save.
    Thnx in advance.
    Regards
    Amit

    Hello amit,
    No, not at all. Surely you will parse your XML file using the NSXMLParser class. OK! i think i get it now, do you wants to change/modify the value of any tag in the XML file? For that you will be required to parse your XML file using NSXMLParser class, and fill out some data structure (according to the the XML format) do some changes into your data structure, and then write your XML to the file (according to the edited data structure) using the method i told u earlier. This is what my preferred method is, and i am pretty much sure that it is not a bad way to do this at all.
    Hope this clarifies some of your queries.
    Best regards,
    Obaid

  • How to get profit center group and its description

    According to three tables(as below), i get profit center group, how to get its description&#65311;
    CEPC  (Profit Center Master Data Table)
    SETLEAF
    SETNODE
    PS:(Referrence to teh link fields in table)
    For Profit centre Group ( SETLEAF-SETNAME )
    Select BSEG-BUKRS / BSEG-PRCTR from BSEG.
    SELECT SINGLE SETNAME INTO WA_SETNAME
    FROM SETLEAF
    WHERE SETCALSS = '0106'
    AND SUBCLASS = BSEG-BUKRS
    AND VALFROM = BSEG-PRCTR
    i can get two records, why?

    Hi,
    I am not sure of the significance of this table...
    But looking at the table structure it is having LINEID as one of the key fields..
    So you can have more than one record for the same combination..
    Thanks,
    Naren

  • How to get the current date and compare dates

    hi
    does anyone know how you would get the current date?
    furthermore, how to compare the current date with a past date to see how many days or months have past since then?
    thanks

    have a look at the Date class. new Date() creates an object containing the exact date and time at creation time. (Date).getTime() might be useful for comparing two dates. GregorianCalendar might be useful, too.

  • How to get (old)previous date and create a loop?

    Hi!!!
    I am using java.util.date object.
    I need to get the 2 months back date,i.e. 60 days back date and to create a loop from that date till today and add it to combobox.
    Suppose today's date=3-12-2001
    x=date-60=3-10-2001
    and wants to create a loop from 3-10-2001 till today to display it in a combobox.
    Please tell me how can I do it?

    try the below which will print the date form 60 days before(from today) to todays date
    import java.util.Calendar;
    import java.util.Date;
    public class RandomNumber
         public static void main(String args[])
              RandomNumber rn = new RandomNumber();
              rn.printDate();
         public void printDate()
              Date todayDate = new Date(System.currentTimeMillis());
              Calendar calendar_ = Calendar.getInstance();
              calendar_.setTime(todayDate);
              calendar_.add(Calendar.DAY_OF_YEAR, -60);
              for(int i=0;i<60;i++)
                   System.out.println(calendar_.getTime());
                   calendar_.add(Calendar.DAY_OF_YEAR, 1);

  • How to get month last date and first date without FM's

    Hi Guru's,
       How can we get  month's first date and last date based on the date given in selection screen without FM's?Is it possible ?
    Like if i give 05-Oct-2008 in the selection screen, i should get the output as 01-Oct-2008 to 31-Oct-2008.Without FM's???
    Regards
    Rakesh.

    Hi Rakesh,
    You can implement this logic as follows:
    You can have two internal tables, one containing the days as numbered 31, 28, 31, and so on with the month number. This holds good if the year is a common year. Another internal table contains days as numbered 31, 29, 31 and so on with the month number. This year would be a leap year.
    An year can be calculated depending on the conditions:
    Say date is given as 20081008
    Concatenate 20081001 + 0(4) into l_date.
    Divide l_date by 4 and remainder should be equal to 0.
    Divide l_date by 400 and remainder should also be equal to 0.
    Then the dominical year will be a leap year.
    Now, if l_date divided by 100 and the remainder is 0 then the year is a common year.
    So depending on this populate the first date and last date from the respective internal table
    Regards,
    Sumalatha N.

  • How to get current system date and store in db

    may i know how to get the current system date so that i can store it into the database

    java.util.Date is NOT deprecated, just most of its methods are.
    Use
    new java.sql.Date(System.currentTimeMillis());to get the current date. Note that the date in a client machine
    may differ from the clock of the server!
    BTW: java.sql.Date extends java.util.Date.
    Fritz

  • [AS][CS4] How to get XML element of grep find result?

    Hi,
    Does anyone know how to get the xml element of a grep find result?
    I have multiple text frames, each containing multiple paragraphs. Each paragraph can contain one or more different xml tagged pieces of text.
    Using a simple search function I can locate the text I need, but how do I retreive the xml element applied to that piece of text.
    Using the "associated XML element" property, it doesn't work.
    set find what of find grep preferences to "€( )*(\\d)*"
    tell active document
              set myResult to find grep
              set myItem to item 1 of myResult
              set myElement to associated XML element of myItem
              -- The last line throws an error
    end tell
    The find result will return a collection of text objects.
    Thanks
    John

    Well I found this post that answered my question
    http://forums.ni.com/t5/LabVIEW/how-to-get-records​et-from-database/m-p/1471374?requireLogin=False

  • How to get the current data and time of SCOM server via SCOM SDK (API) calls?

    Hi,
    I need to read the current date and time of SCOM server via SOM SDK.
    Is there a class in SDK that provides this info ?
    Thanks,
    satheesh

    To get time and date of Alerts of SCOM, You can use following command let "get-scomalert"
    Also, You can refer below links
    http://blog.tyang.org/2013/02/21/using-scom-2012-sdk-to-retrieve-resource-pools-information/
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical

  • How to get local file date and time ( 10g version )

    Hi,
    Would like to ask if there is any way to get the date and time of a local file. It seems that webutil does not have this function.
    And I want to use client_host ( dir c:\file.txt > c:\temp.txt ) and the read this file to get the file date.
    But the problem is the file date and time ( in the dir ) varies in different PCs.
    Best Regards,
    Ivan

    But the problem is the file date and time ( in the dir ) varies in different PCs.
    You mean the format of the date and time don't you?
    If so you maybe could create a java bean which does that for you using the lastModified Method of the File class.
    regards

  • How to get sql query data and write into csv file?

    I am writing to seek help, in how can I create bat. script which can execute the following logic:
    connection to the database
    run sql query
    create CSV file
    output query data, into CSV file
    save the CSV file
    osql
    -S 84.18.111.111
    -U adw
    -P rem
    -i "c:\query.sql"
    send ""
    sed -e 's/,\s\+/,/g' MCI_04Dec2014.csv > localNoSpaces.csv
    -o "c:\MCI_04Dec2014.csv"
    This what i have so far, and I am little struggling with the logic after creating CSV file. I am unable to get the above script to work, please advice further, where I may be going wrong. 
    Can you create if statement logic within window's script, to check for null parameters or data feeds?
    Any hints would be most appreciated. 

    Thank you for your reply. 
    Apology for posting the code irrelevant to the forum, as I am still novice scripting user.  
    My goal is to create window's script which can compute the above logic and send the final output file (csv), to FTP folder. 
    Can this logic be implemented via bat. script, if so, is there a example or tutorial i could follow, in order to achieve my task. 
    Any help would be much appreciated. 

Maybe you are looking for

  • Persistent Chat (Lync Server 2013) with Lync 2010 Group Chat

    I have successfully deployed Lync Server 2013 and both 2013 and 2010 desktop clients connect and function as expected. The problem is with Persistent Chat. It works perfectly with the 2013 desktop client but - whilst 2010 Group Chat connects - I rece

  • How to find users sessions connected in (11.1.0.7 & R12.1.1)

    We have 11.1.0.7 configured in our env with E-business suite R 12.1.1 . we created different users e.g John , Mark and they are connected through e-business suite application form. But when i query V$session table i dont find these users there. Where

  • Shmat call fails in Solaris 8 when BDB 4.2.50 is used

    Hi, We have two separate applications App1 and App2 which communicate via shared memory on Solaris 8. App1 creates a shared memory region and writes into it and exits. App2 gets the shmid and attaches to it and reads data from it. App1 and App2 both

  • VO row seen even after rollback

    Hello, I have a search page and table below, listing search results. Result table also has "Create Entity" button, when user clicks on this button, user is taken to create entity page, whose processRequest does following (after doing standard checks)

  • When I open Safari, how do I expand the size of the box?

    I can't seem to figure out the MBP command to expand the box once I click on Safari, or another application. I would like for it to take over the entire screen.