XML : How to extract children

The following is a call to amazon.com to return
sub-categories - in this case Baby > Activities.
<cfhttp url="
http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&SubscriptionId=02C1DF8A E32GQ219EC02&AssociateTag=intellifit-20&Operation=BrowseNodeLookup&BrowseNodeId=542460"
method="GET" resolveurl="yes" throwonerror="yes">
<cfset results = XmlParse(cfhttp.FileContent)>
<cfdump var="#results#">
Works properly and the <cfdump ...> return a well
formed structure.
Here is where I get stuck : there are some of children that I
need to extract and I am no able to apply various examples of
"XmlSearch" or some <cfscript>s in Macromedia - sorry - Adobe
LiveDocs.
Please help a color-by-numbers newbie.
A nice Memorial Day weekEnd everybody.
ContiW

DKDK
Following your advice I got
<cfloop from="1"
to="#arrayLen(results.xmlRoot.XmlChildren[2].XmlChildren[2].XmlChildren[3].XmlChildren)#"
index="i">
<cfoutput>
#results.xmlRoot.XmlChildren[2].XmlChildren[2].XmlChildren[3].XmlChildren
.XmlChildren[2]#
#results.xmlRoot.XmlChildren[2].XmlChildren[2].XmlChildren[3].XmlChildren.XmlChildren[1]#
</cfoutput>
<br>
</cfloop>
to give me exactly what I needed. Thank you.
Nevertheless, i would love to know how you have got the
values for each level of children.

Similar Messages

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? "
    i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
    i could be ver thank full if u could solve my problem.
    [email protected]

    Hi,
    This is some skeleton code for extracting an attachment from a SOAPMessage.
    import javax.activation.DataHandler.;
    import javax.xml.soap.*;
    import javax.xml.message.*;
    Iterator allAttachments = message.getAttachments();
    AttachmentPart ap1 = null;
    while(allAttachments.hasNext()){
    ap1 = (AttachmentPart)allAttachments.next();
    //Check that the attachment is correct one. By looking at its mime headers
    //Convert the attachment part into its DOM representation:
    if(ap1.getContentType() == "text/xml"){
    //Use the activation dataHandler class to extract the content, then create a StreamSource from
    //the content.
    DataHandler attachmentContent = ap1.getDataHandler();
    StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
    DOMResult domAttachment = getDOMResult(attachmentStream);
    domAttachment holds an xml representation of the attachment.
    Hope this helps.

  • How to extract data from XML file with JavaScript

    HI All
    I am new to this group.
    Can anybody help me regarding XML.
    I want to know How to extract data from XML file with JavaScript.
    And also how to use API for XML
    regards
    Nagaraju

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • How to extract xml

    <ROOT>
    <TEST>
    <TESTING>
    <ROW1>1</ROW1>
    <ROW2>2</ROW2>
    <ROW3>3</ROW3>
    </TESTING>
    </TEST>
    </ROOT>
    How to extract the xml as this output ,above xml will come as parameter.
    I can achieve it is stored in table i can able to get by using xpath.
    As parameter i cant able to do it.Kindly help.
    SELECT extract(xmldata,'/ROOT/TEST/TESTING')
    FROM EAPP
    I can get this output if that xml is stored in xml.
    But my requiremnet is before storing i want to eliminate root tag and test tag and i want to insert.
    as below example
    <TESTING>
    <ROW1>1</ROW1>
    <ROW2>2</ROW2>
    <ROW3>3</ROW3>
    </TESTING>
    SELECT VALUE(p)
    FROM
    TABLE(XMLSEQUENCE(EXTRACT(xmldata, '/ROOT/*'))) p
    but it is not working .
    Edited by: LRAJESH on Oct 22, 2010 1:21 AM

    You mentioned a parameter so I'm going to assume you are doing the processing in PL/SQL.
    One approach would be to use method 4 at
    http://anononxml.blogspot.com/2010/05/one-question-that-comes-up-with-some.html
    and leave the /text() off of the end of the XPath. As the first Gotcha lists, this will return an XML fragment containing all the nodes you want.
    You can still parse the XML in a SQL statement as you are trying to do. Just replace the table.column reference with your PL/SQL variable.
    If you are on 10.2.x.x or greater, look into using XMLTable instead of TABLE(XMLSEQUENCE(EXTRACT(...))) For the COLUMN, you would want to return an XMLType.
    Yes I'm being a bit vague on purpose. There are lots of examples on the forums already. Still don't know what version of Oracle you are using either.

  • How to extract xml tag name contains dashes

     
    Hi, How to parse XML file to extract root tag contains dashes in Flex,for example
    XML Input is: <regular-body>Text of my post...</regular-body>
    expected output is : regular-body
    I appreciate any of your suggestions or inputs

    Do you want to get the name of the XML ELEMENT regular-body, or the value in the XML file "Text of my post...".
    If its the latter, then you could use the bracket/quote notation for extracting the value, like in the following example:
    image = xmlWeather[0]..parameters["conditions-icon"]["icon-link"][idx]
    I use this when parsing weather information from a 3rd party in which their XML is loaded with dashes.
    If you are looking to get the actual element name, not sure how to do that.  I would think that if you are using an XML file, you would have at least the high level element known.

  • How to extract XML from EAR file?

    how to Extract weblogic-application.xml file from StellentPortlets.ear file ???

    http://en.wikipedia.org/wiki/EAR_(file_format)
    An EAR file is a standard JAR file (and therefore a Zip file) with a .ear extension, with one or more entries representing the modules of the application, and a metadata directory called META-INF which contains one or more deployment descriptors.
    7zip is a nice tool for me but most any should be usable.

  • When importing XML, how do I remove lines with labels but no content?

    I am working on a directory whose content is supplied as an XML file. I've created an automatic layout with static text/labels for contact details (e.g. Phone, Fax).
    When I import the file, superfluous lines with the static text and no content are created. I have 'Delete elements, frames and content that do not match imported XML' checked.
    Is there a way of avoid creating these? I've tried doing a search and replace to remove these but this causes quite a few other problems.
    Any help - much appreciated!

    Hi Alison,
    Did you create the posted XML file by extracting it from a larger file you've been using successfully? I ask because there seem to be a couple of problems with it which make me wonder how you got it to work at all, at least with the provided InDesign file's XML structure:
    The immediate child element of the "root" element in the XML document is one called "step2 ". All of the values with which you are concerned are children of that "step2" element, and yet the structure in the InDesign document contains no "step2" element. As a result, when I import, I get nothing at all in my InDesign document's content (though the data are in the XML structure, buried in a newly-created "step2" element.
    In both the XML and the InDesign document's XML structure, you have two different elements which are both named the exactly the same - "description" - (actually, in the XML document, there are three of them). When InDesign imports XML, it stops after the first "match" that it finds, so this will not work in any way that I imagine you intend it to. Based on the content of your InDesign document, I would think there ought to be two separate elements in your XML - named something like "step_description" and "category_description".
    If, after getting this all straightened out, your question is how to somehow make the text of an empty element (e.g., <description></description>) disappear in the imported result, there are a few possibilities:
    Get rid of the text inside the tag markers in your template/base document - for example, instead of having "[step_description]" (where the "[]" represent the tag markers), just make it be "[]". That way, if there is no text value for "step_description", there will be no text left after the import. However, if you put a end-of-paragraph in your template/base file, that will still be there. In most cases, that's not desired, so you might want to put the empty tag ("[]") in the text flow without a carriage return/line break. If you do that, you will need to include the carriage return in the XML data (which admittedly slightly violates the notion of separating presentation from content). Rather than the xml looking like this:
    <step_description>This is the text of my step description.</step_description> you would need to make it be this:
    <step_description>This is the text of my step description.&#13;</step_description>
    (having added "&#13;" to represent the carriage return (ASCII character 13).
    As above, make the tag an empty one, include the carriage return in your InDesign template/base document, and then write (or have written) a script to run after the XML import to deal with such empty tag cases.
    Upgrade to InDesign CS3, CS4, or soon, CS5, so you can take advantage of the "XML Rules" feature which was introduced in CS3. XML Rules will essentially allow you to automate the second option - running a script - as the XML import is taking place.
    Excuse the long (and probably unclear) post. If I've misunderstood your question, then please excuse it doubly...

  • How to extract data from SAP in FDM 11121

    I came across some documents from version 11113, says there is a SAP adapter, however ,when I check 11121 there's no such adapter, does anyone know how to extract data from SAP in FDM 11121?

    I download a package from Bristlecone, but I dont see any xml files in it, just a bunch of dll and I didn't find any instructions on how to set up/configure in FDM, it just explained how to register in SAP app server and client.
    Hyperion 11113 has readme on sap adapter(Hyperion Readme Template), but I cannot find the same readme file in 11121, all I can find is ERP Integration Adapter document. any idears where I can find at least a readme document?

  • How to extract data from a resultset returned by SQLX query

    Hi all,
    I'm doing a project in which I use SQLX query to extract data and format it into xml from an object-relational database, and return it to a windows application. But when the resultset is returned, I don't know how to extract and display the data from it. The datatype of returned data might be XmlType, but i don't know how to process it..Can anyone help? It's urgent.. Thanks a lot in advance...
    Joanne

    You can use XMLType.extract().

  • How to Extract particular field from a string ( Mapping)

    how to exteract the particular field from the given string:
    ProcessEmp this element has a below string subfields.
    <ProcessEmp>&lt;?xml version="1.0" encoding="utf-8" standalone="no"?&gt;
    &lt;Employee PersonnelNumber="11111" FirstName="String" MiddleName="String" LastName="String" Department="String" Group="" SapUserID="10flname" EmailAddress="[email protected]" DefaultPassword="*" Status="Success" /&gt;</ProcessEmp>
    how to extract only PersonalNumber, department, EmailAddress from above ProcessEmp into 3 diff fields.
    Thanks
    dhanush.

    Hi,
    You are receiving XML message within a field. To access a particular field from that XML message, you could create a User Defined Function, as suggested by many already.
    You could write UDF using some of the String operation functions. This could include following:
    1. If you need to access field Employee PersonnelNumber, you could get last index of that within string using function lastIndexOf(String str). Pass string "Employee PersonnelNumber="" for this function.
    2. This function would return an index of rightmost occurance of this string.
    3. after this you could get the index of next occurance of ", as the value of field is within quotes. You could use function indexOf(int ch, int fromIndex) for getting the same. You would pass Character as " and index as the one received by previous function.
    4. Now you have index for starting and ending point of value string for desired field.
    5. After this you could use substring(int beginIndex, int endIndex) function by passing first and second index values to retrieve the needed string, which contains value of field.
    Hope this would be helful.
    Thanks,
    Bhavish
    Reward points if comments found helpful:-)

  • How to extract SDA file..........

    Hi All
        how do we extract SDA files.......
        we started adapter development by testing sample code in 'sample_ra.jar'  file,  available in sample_ra.sda, and deployed on XI server. now we want to see all jar files available in 'sample_ra.sda'.
    if any one already gone through adapter development have any idea, how to extract SDA file, help me out Pls .......... very urgent.
    Regards
    Rajesh

    HI,
    In general SDA files are to be deployed into Server using SDM.
    see the below link , how to deploy
    http://help.sap.com/saphelp_webas630/helpdata/en/05/4fac3e00c8b014e10000000a114084/content.htm
    Also
    you can unzip the file with WinZip or WinRar edit the xml configuration file and zip it back together (in ZIP format and not RAR!).
    Also
    how to deploy ear files from command line
    Tools like zipgenius http://www.zipgenius.it/intweb/features.htm#Innovazione, Private encryptor http://www.filesweb.com/private-encryptor/ and securefile http://www.devsolutions.net/htmlpages/securefile.html should help you further.
    Regards
    Chilla

  • How to extract war file

    how to extract war file? explain technoloby behind in war

    hi
    go to your dir :
    jar xvf filename.warhelp, simply type jar, above baluc mention is right, jar/war/ear is like a zip file contains *.classes, images, xml , etc....
    jar i hope it will help u

  • How to extract the date value of IBOR date="12/12/2009"

    I have the following query, but do not get the date value out:
    WITH ibors AS (
    SELECT xmltype('<?xml version="1.0" encoding="utf-8"?>
    <IBOR date="12/12/2009">
    <LIBOR currency="USD">
    <OneYear>1.38875</OneYear>
    </LIBOR>
    </IBOR>
    ') ibor_xml
    FROM dual
    SELECT i.ibor_date, i.ibor_oneyear
    FROM ibors,
    XMLTABLE(
    '//IBOR'
    PASSING ibors.ibor_xml
    COLUMNS ibor_date VARCHAR2(20) PATH '/IBOR/date',
    ibor_oneyear VARCHAR2(20) PATH '/IBOR/LIBOR/OneYear'
    ) i;
    How to extract the date value of <IBOR date="12/12/2009">?

    Hi,
    The date is an attribute of element IBOR. So you must use "@date" in the xpath expression :
    WITH ibors AS (
    SELECT xmltype('<?xml version="1.0" encoding="utf-8"?>
    <IBOR date="12/12/2009">
    <LIBOR currency="USD">
    <OneYear>1.38875</OneYear>
    </LIBOR>
    </IBOR>
    ') ibor_xml
    FROM dual
    SELECT i.ibor_date, i.ibor_oneyear
    FROM ibors,
    XMLTABLE(
    '//IBOR'
    PASSING ibors.ibor_xml
    COLUMNS
    ibor_date VARCHAR2(20) PATH '/IBOR/@date',
    ibor_oneyear VARCHAR2(20) PATH '/IBOR/LIBOR/OneYear'
    ) i;

  • How to extract the image field content?

    Hi, experts
    I placed an image fields on an interactive form , user can upload jpg file into this field.
    Could you pls tell me how to extract that using programming languages with the help of XML DOM?
    I built a sample program that can retrive the content of the field, which is of type string, then when i save it to local drive, the image can not be displayed correctly.
    could you pls tell me how to solve that?
    br.
    Jun

    Jun,
    Did you figure this out on your own? Any one out there have an answer?
    Leti

  • Seeburger AS2 Adapter - How to extract copy of file sent out ?

    Hi Experts,
    The scenario is SAP R/3 sends idoc to PI.  PI converts this into a flat file and sends to Trading Partner through Seeburger AS2 adapter.
    We can trace the message content in XML format within PI using SXMB_MONI or RWB.   How to extract a copy of the Flat file converted by AS2 adapter and sent to Trading Partner ?
    Thanks very much for you help !
    Thanks,
    Rukmani

    >>Was hoping for a method that does not need additional coding.
    None of the two methods I suggest require coding. First method just require adding 1 line in module config in your communication channel. Second method requires one addition config in receiver determination and agreements.
    >>is there a way to get the converted message content from SeeBurger Workbench even for successful messages ?
    No. If you have purchased Message Tracking, then you could configure that for your scenarios to view payloads. However, this method will definitely need some coding.
    Regards,
    Prateek Raj Srivastava

Maybe you are looking for