XML Question - Parse out node

My program processes an xml data stored in CRM.
The program extracts the XML data as a string. I need to be able to access the data contained within a particular node.
The node <result> contains my data. I need to extract these values to do subsequent data table lookups.
Any assistance in gaining access to the result node values is appreciated.
An example of the file is shown below:
<?xml version="1.0" encoding="utf-8"?>
<survey xmlns:abapsurvey="http://www.sap.com/abapsurvey" xmlns:bee="http://www.sap.com/survey/bee" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:htmlb="http://www.sap.com/survey/htmlb" xmlns:out="http://www.w3.org/1999/XSL/Output" xmlns:svy="http://www.sap.com/survey/svy" xmlns:tmp="http://www.sap.com/survey/tmp" xmlns:values="http://www.w3.org/1999/XSL/TransformValues" xmlns:wff="http://www.mysap.com/wff/2001">
  <ratingfactor>
    <id_5067ea774ce37c4a998c56c296ef383e>0 </id_5067ea774ce37c4a998c56c296ef383e>
    <q1>1 </q1>
    <id_77cdd93138447b4b993442c2918b8bdb>0 </id_77cdd93138447b4b993442c2918b8bdb>
    <id_37721faa404c814d9bc265b4f19887f0>0 </id_37721faa404c814d9bc265b4f19887f0>
    <id_00ec9ccaf7f98542995c5b97261c90d1>0 </id_00ec9ccaf7f98542995c5b97261c90d1>
    <id_74592f01f5cc2440a87fedda3754db8e>0 </id_74592f01f5cc2440a87fedda3754db8e>
  </ratingfactor>
  <result>
    <id_5067ea774ce37c4a998c56c296ef383e>
      <id_3887d603f663d644a03b8212f3af24e7>id_eb6cae9b1688f84babeaae6c2aa53796</id_3887d603f663d644a03b8212f3af24e7>
    </id_5067ea774ce37c4a998c56c296ef383e>
    <q1>
      <a1>id_1f84102b913e3344a38cc166a9933452</a1>
    </q1>
    <id_77cdd93138447b4b993442c2918b8bdb>
      <id_275bf37ff1a68f4c88aaf7d4fa6cd4dc>id_a655b90477634640955428143e4a6f66</id_275bf37ff1a68f4c88aaf7d4fa6cd4dc>
    </id_77cdd93138447b4b993442c2918b8bdb>
    <id_37721faa404c814d9bc265b4f19887f0>
      <id_4915c8ad1dcf2740ac545d3ffd2a0af6>id_65d7c9277da37648b6600de52e2a095e</id_4915c8ad1dcf2740ac545d3ffd2a0af6>
    </id_37721faa404c814d9bc265b4f19887f0>
    <id_00ec9ccaf7f98542995c5b97261c90d1>
      <id_2ef55b647e558a4eba40e8f78d15818d>id_46aabd5305894649b9d28f15c0e439b7</id_2ef55b647e558a4eba40e8f78d15818d>
    </id_00ec9ccaf7f98542995c5b97261c90d1>
    <id_74592f01f5cc2440a87fedda3754db8e>
      <id_6182ead1dd8fe74abe9feccb316a86d3>This is my additional info for the customer.
    </id_74592f01f5cc2440a87fedda3754db8e>
  </result>
</survey>

I hope I understood you correctly.  This program finds the begining of <result> and the end of </result> and shows whats in the middle. 
report zrich_0001 line-size 500.
data: result_start type i.
data: result_end   type i.
data: offset type i.
data: xml_string type string.
xml_string = '<?xml version="1.0" encoding="utf-8"?><result>' &
             '<id_5067ea774ce37c4a998c56c296ef383e>' &
             '<id_6182ead1dd8fe74abe9feccb316a86d3>' &
             'This is my additional info for the customer.' &
             '</id_74592f01f5cc2440a87fedda3754db8e> ' &
             '</result></survey>'.
search xml_string for '<result>'.
if sy-subrc  = 0.
  result_start = sy-fdpos.
endif.
search xml_string for '</result>'.
if sy-subrc  = 0.
  result_end = sy-fdpos.
endif.
* the plus nine accounts for the "</result>"
offset = ( result_end - result_start ) + 9.
write:/ xml_string+result_start(offset).
check sy-subrc  = 0.
Regards,
Rich Heilman

Similar Messages

  • How do I pull XML data by a node name?

    I am new to Flash and XML so I hope I am not asking a
    completely dumb question. I have figured out how to retrieve data
    from and XML file by the node possition but now I would like to
    know how to pull it by a specific node name. Here is what I
    currently have:
    on (rollOver)
    myLot = 1;
    _root.myInfo =
    _root.myXML.childNodes[0].childNodes[this.myLot].childNodes[0].childNodes[0].nodeValue;
    With XML file like this:
    <SectionOne>
    <Lot1>
    <Lot>1</Lot>
    <Price>$450,000</Price>
    <Status>Active</Status>
    </Lot1>
    <Lot4>
    <Lot>4</Lot>
    <Price>$389,000</Price>
    <Status>Sold</Status>
    </Lot2>
    </SectionOne>
    What I would like is to pull instead of
    childNodes[this.myLot] to pull the node named Lot1. The problem I
    have is I don't always have consecutive lot numbers and I don't
    want to have to build in blank xml lines for a placeholder. I hope
    that makes sense.

    Sorry for the delay. I originally posted this on the
    newsgroup, but I suppose it did not propagate to here.
    What you would do is use a loop statement and compare the
    nodeNames.
    To see a nodes name such as Lot1 you use:
    childNodes[x].nodeName
    // Load up the lotNodes object
    lotNodes = _root.myXML.childNodes[0];
    // Now lotNodes contains all the nodes Lot0, Lot1, Lot2.....
    // Iterate through all of lotNodes childNodes and compare the
    // nodeName until you find the one you want then drill down
    // it to get the info you want.
    for( var counter01 = 0;counter01 <
    lotNodes.childNodes.length;counter01++){
    if(lotNodes.childNodes[counter01].nodeName == "Lot1"){
    myInfo =
    lotNodes.childNodes[counter01].childNodes[0].childNodes[0].nodeValue;
    I have not had time to test this but it should work, I'll
    double check it after work.
    I hope this helps get you moving forward.
    If you have any other problems or can't get it to work, let
    me know here or email me. Preferably here, so others can learn and
    help.
    Scotty
    [email protected]

  • XML Custom Parser

    I am tryint to write a custom XML parser but I am having trouble accessing the Value fields. I need to use one of the Value Fields to determine which parser I need to use for my custom Class Objects. Below is my sample code and a sample XML Document that I am trying to Parse. I hope that it will reformat. If not then I am sorry for the format.
    public LibraryObject parse(InputStream p_file, ParserCallback p_callBack, Hashtable p_opts)
    throws oracle.ifs.common.IfsException
    XMLDocument xmlDoc = new XMLDocument();
    IfsXmlParser parser = new IfsXmlParser(m_Session);
    xmlDoc = parser.createDOM(p_file, false);
    NodeList list = xmlDoc.getElementsByTagName("Value");
    for (int i=0; i < list.getLength(); i++) {
    printNodeInfo(list.item(i));
    // This gives me a Type Casting error!
    // Here is the problem
    CharacterData temp = (CharacterData)list.item(i);
    <?xml version='1.0'?>
    <Records>
    <Record>
    <Field id='Remote_User' type='string' length='30'></Field>
    <Field id='Time_Stamp' type='string' length='30'><Value>02/01/01 02:03:13 PM</Value></Field>
    <Field id='Suspense_File' type='string' length='30'><Value>T:\teleform\bat\00000053\7H6CUO0000.tct</Value></Field>
    <Field id='Remote_Uid' type='number' length='10'><Value>-1</Value></Field>
    <Field id='Remote_Fax' type='string' length='30'><Value>Y087EY0000.TIF</Value></Field>
    <Field id='Form_Id' type='number' length='10'><Value>18567</Value></Field>
    <Field id='OrigPgSeq' type='string' length='128'><Value>0</Value></Field>
    <Field id='Orig_File' type='string' length='128'><Value>T:\teleform\bat\00000053\HDKHBA0000.tct</Value></Field>
    <Field id='SKFI_Zone_1' type='string' length='30'></Field>
    <Field id='First_Name' type='string' length='15'><Value>Jason</Value></Field>
    <Field id='Middle_Name' type='string' length='15'><Value>Paul</Value></Field>
    <Field id='Last_Name' type='string' length='30'><Value>Adkison</Value></Field>
    <Field id='Suffix' type='string' length='10'><Value>Mr</Value></Field>
    <Field id='Address_1' type='string' length='50'><Value>5532 Overlook NE</Value></Field>
    <Field id='Address_2' type='string' length='50'><Value>Albuquerque</Value></Field>
    <Field id='Zip_Code' type='string' length='15'><Value>87111</Value></Field>
    <Field id='Home_Phone' type='string' length='15'><Value>505-555-5555</Value></Field>
    <Field id='Work_Phone' type='string' length='15'><Value>505-555-5555</Value></Field>
    <Field id='E_Mail' type='string' length='20'><Value>[email protected]</Value></Field>
    </Record>
    </Records>

    Jason
    You are making incorrect assumptions regarding what is contained in the NodeList.
    The folllowing should explain
    public void doSomething(LibrarySession ifs)
    throws IfsException
    try {
    InputStream is = new FileInputStream("c:\\temp\\testfile.xml");
    IfsXmlParser parser = new IfsXmlParser(ifs);
    XMLDocument xmlDoc = parser.createDOM(is,false);
    xmlDoc.print(System.out);
    NodeList nodes = xmlDoc.getElementsByTagName("Value");
    for (int i=0;i<nodes.getLength();i++) {
    Node node = nodes.item(i);
    System.out.println("Node " + i + " is an instance of " + node.getClass());
    System.out.println("The value of the Text for the Node is " + node.getFirstChild().getNodeValue());
    } catch (java.io.IOException x) {
    throw new IfsException(9999,x);
    generates
    Transaction Started.
    <?xml version = '1.0'?>
    <Records>
    <Record>
    <Field id="Remote_User"
    type="string" length="30"/>
    <Field id="Time_Stamp" type="string" length="30">
    <Value>02/01/01 02:03:13 PM</Value>
    </Field>
    <Field id="Suspense_File" type="string" length="30">
    <Value>T:\teleform\bat\00000053\7H6CUO0000.tct</Value>
    </Field>
    <Field id="Remote_Uid" type="number" length="10">
    <Value>-1</Value>
    </Field>
    <Field id="Remote_Fax" type="string" length="30">
    <Value>Y087EY0000.TIF</Value>
    </Field>
    <Field id="Form_Id" type="number" length="10">
    <Value>18567</Value>
    </Field>
    <Field id="OrigPgSeq" type="string" length="128">
    <Value>0</Value>
    </Field>
    <Field id="Orig_File" type="string" length="128">
    <Value>T:\teleform\bat\00000053\HDKHBA0000.tct</Value>
    </Field>
    <Field id="SKFI_Zone_1" type="string" length="30"/>
    <Field id="First_Name" type="string" length="15">
    <Value>Jason</Value>
    </Field>
    <Field id="Middle_Name" type="string" length="15">
    <Value>Paul</Value>
    </Field>
    <Field id="Last_Name" type="string" length="30">
    <Value>Adkison</Value>
    </Field>
    <Field id="Suffix" type="string" length="10">
    <Value>Mr</Value>
    </Field>
    <Field id="Address_1" type="string" length="50">
    <Value>5532 Overlook NE</Value>
    </Field>
    <Field id="Address_2" type="string" length="50">
    <Value>Albuquerque</Value>
    </Field>
    <Field id="Zip_Code" type="string" length="15">
    <Value>87111</Value>
    </Field>
    <Field id="Home_Phone" type="string" length="15">
    <Value>505-555-5555</Value>
    </Field>
    <Field id="Work_Phone"
    type="string" length="15">
    <Value>505-555-5555</Value>
    </Field>
    <Field id="E_Mail" type="string" length="20">
    <Value>[email protected]
    </Value>
    </Field>
    </Record>
    </Records>
    Node 0 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is 02/01/01 02:03:13 PM
    Node 1 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is T:\teleform\bat\00000053\7H6CUO0000.tct
    Node 2 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is -1
    Node 3 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is Y087EY0000.TIF
    Node 4 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is 18567
    Node 5 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is 0
    Node 6 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is T:\teleform\bat\00000053\HDKHBA0000.tct
    Node 7 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is Jason
    Node 8 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is Paul
    Nod e 9 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is Adkison
    Node 10 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is Mr
    Node 11 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is 5532 Overlook NE
    Node 12 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is Albuquerque
    Node 13 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is 87111
    Node 14 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is 505-555-5555
    Node 15 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is 505-555-5555
    Node 16 is an instance of class oracle.xml.parser.v2.XMLElement
    The value of the Text for the Node is [email protected]
    Transaction Completed.
    Successful End of Program.
    null

  • "Eval Parsed Formula Node VI" does not return outputs in predefined order

    I make a data analysis program, where the data consists of some million events and each event has e.g. 4 channels and 1-5 hits on each channel. 
    I would like the user to select different expressions of these channels to give coordinates to plot in a 2D histogram (increment a bin in Intensity Graph), e.g. for some experiment you want to show x=ch1-ch2; y=ch1+ch2+ch3+ch4; while in another experiment you want x=ch1-123; y=123-ch2;
    There are other VIs that use static LabView-code for the normal things, but now after a few years of adding to this program I find that it would be quite good with a general plotter and let the user specify simple expressions like this. Also with the "normal" static plots, there is a need to filter out bad data and then it would be much simpler both to program and use if you could write text expressions with boolean logic to combine multiple filters. Making a LabView code and GUI that allows AND/OR/parenthesis combinations of expressions will be quite an effort and not very reusable.
    So, with the above motivation, I hope you see that it would make sense to have a useable string formula evaluator in LabView. I find some info about MathScript's user-defineable functions, but haven't managed to get MathScript working in LV2010 yet (maybe some licensing or installation issues, I think I had it in 8.6). But I think it would be possible to do most of what I want for the display-part (not the filtering) with the simpler Eval/Parse Formula Node VIs and suitable use of the limited variable name space. So I started testing, and found a quite annoying issue with how the evaulator works.
    To the parser, you are expected to send an array of output variable names. But then it ignores this array, and returns one output per assignment/semicolon in the formula, in the order of the formula text. Since the static parts of my program need to know what the output values mean (which of them is x and which is y), I would have to rely on the user not using any intermediate variable and defining x before y. The attached screenshot demonstrates the problem, and also that it has been solved by NI statff in the "Eval Formula Node VI" which does the appropriate array-searching to extract only the pre-defined outputs, in their expected order. But using that VI is about 100 times as slow, I need to pre-compile the formula and then only use the evaulator in the loop that runs over a million events.
    I don't know if I'll take the time to make my own tweks to the parsing stage (e.g. preparation of array-mapping to not have to repeat the search or maybe hacking the output list generated by the parser) or if I'll have to make it in a static Formula Node in the block-diagram (which supports more functions), so that the user has to run with development environment and stop the program to change the plotting function. But I wanted to share this trouble with you, in hope of improvments in future LabView versions or ideas from other people on how I could accomplish my aim. I have MATLAB-formula node possibility too, but is far as I have seen the only place the user could update the formula would then be in a separate .m file, which is re-read only when typing "clear functions" in the Matlab console window. (Having this window is also an annoyance, and perhaps the performance of calling Matlab in every iteration is not great.) 
    Besides this issue, it also seems very strange there is virtually no support for conditional expressions or operators in Formula Node evaulated formulas (called Mathematics VIs in the documentation). Maybe using (1+sign(a-b))/2 you can build something that is 0 when a<b and 1 when a>b, but it is not user friendly! Would it really be diffcult to add a function like iif(condition, return_value_if_true, return_value_if_false) to replace the unsupported "condition ? if_true : if_false" operator? Would it really be difficult to add support for the < <= >= > == || && operators? Although compiled to an assemply language, this can't exactly be difficult for a CPU.
    Attachments:
    LV script test.png ‏62 KB
    LV script test.vi ‏18 KB

    (1) You can put any kind of code inside an event structure with the limitation that it should be able to complete quickly and without user interaction.  For example a while loop for a newton-raphson method is fine, but an interactive while loop where the stop condition depends on user iteraction is not recommended. By default, event structures lock the front panel until the event completes, so you would not even be able to stop it.
    (2) Yes, you can do all that. LabVIEW has no limitation as a programming language. Use shift registers to hold data and state information, the manipulate the contents as needed.
    (3) I would recommend to use plain LabVIEW primitives instead of formula nodes. Show us your code so we can better see what it's all about. Obviously you have a mismatch betweeen scalars and arrays. It is impossible from the given information where the problem is.
    (4) Yes, look inside the nonlinear curve fit VI (you can open it an inspect the code!). One of the subVIs does exactly that. Just supply your model VI.
    LabVIEW Champion . Do more with less code and in less time .

  • SSMS 2012:FOR XML PATH Using XPath Node Tests-Columnn name 'test()' contains an invalid XML identifier as required by FOR XML?

    Hi all,
    I am learning XPATH and XQUERY from the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles, (published by apress). I copied the Code Listing 12-8 FOR XML PATH Using XPath Node Tests (listed below) and executed it in my
    SQL Server 2012 Management Studio:
    --Coles12_8.sql // saved in C:/Documemnts/SQL Server Management Studio
    -- Coles Listing 12-8 FOR XML PATH Using XPATH Node Tests
    -- Retrieving Name and E-mail Addresses with FOR XML PATH in AdvantureWorks
    -- 16 March 2015 0935 AM
    USE AdventureWorks;
    GO
    SELECT
    p.NameStyle AS "processing-instruction(nameStyle)",
    p.BusinessEntityID AS "Person/@ID",
    p.ModifiedDate AS "comment()",
    pp.PhoneNumber AS "test()",
    FirstName AS "Person/Name/First",
    MiddleName AS "Person/Name/Middle",
    LastName AS "Person/Name/Last",
    EmailAddress AS "Person/Email"
    FROM Person.Person p
    INNER JOIN Person.EmailAddress e
    ON p.BusinessEntityID = e.BusinessEntityID
    INNER JOIN Person.PersonPhone pp
    ON p.BusinessEntityID = pp.BusinessEntityID
    FOR XML PATH;
    I got the following error message:
    Msg 6850, Level 16, State 1, Line 2
    Column name 'test()' contains an invalid XML identifier as required by FOR XML; '('(0x0028) is the first character at fault.
    I have no ideas why I got this error message.  Please kindly help and advise me how to resolve this error.
    Thanks in advance,  Scott Chang

    Hi Michelle, Thanks for your nice response.
    I corrected the mistake and executed the revised code. It worked nicely.
    I just have one question to ask you about the appearance of the xml output of my Co;les12_8.sql:
    <row>
    <?nameStyle 0?>
    <Person ID="1" />
    <!--2003-02-08T00:00:00-->697-555-0142<Person><Name><First>Ken</First><Middle>J</Middle><Last>Sánchez</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="2" />
    <!--2002-02-24T00:00:00-->819-555-0175<Person><Name><First>Terri</First><Middle>Lee</Middle><Last>Duffy</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="3" />
    <!--2001-12-05T00:00:00-->212-555-0187<Person><Name><First>Roberto</First><Last>Tamburello</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="4" />
    <!--2001-12-29T00:00:00-->612-555-0100<Person><Name><First>Rob</First><Last>Walters</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="5" />
    <!--2002-01-30T00:00:00-->849-555-0139<Person><Name><First>Gail</First><Middle>A</Middle><Last>Erickson</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="6" />
    <!--2002-02-17T00:00:00-->122-555-0189<Person><Name><First>Jossef</First><Middle>H</Middle><Last>Goldberg</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="7" />
    <!--2003-03-05T00:00:00-->181-555-0156<Person><Name><First>Dylan</First><Middle>A</Middle><Last>Miller</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="8" />
    <!--2003-01-23T00:00:00-->815-555-0138<Person><Name><First>Diane</First><Middle>L</Middle><Last>Margheim</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="9" />
    <!--2003-02-10T00:00:00-->185-555-0186<Person><Name><First>Gigi</First><Middle>N</Middle><Last>Matthew</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="10" />
    <!--2003-05-28T00:00:00-->330-555-2568<Person><Name><First>Michael</First><Last>Raheem</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="11" />
    <!--2004-12-29T00:00:00-->719-555-0181<Person><Name><First>Ovidiu</First><Middle>V</Middle><Last>Cracium</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    I feel this xml output is not like the regular xml output.  Do you know why it is diffrent from the regular xml xml output?  Please comment on this matter.
    Thanks,
    Scott Chang
    What do you mean by regular xml document? Are you referring to fact that its missing a root element? if yes it can be added as below
    USE AdventureWorks;
    GO
    SELECT
    p.NameStyle AS "processing-instruction(nameStyle)",
    p.BusinessEntityID AS "Person/@ID",
    p.ModifiedDate AS "comment()",
    pp.PhoneNumber AS "text()",
    FirstName AS "Person/Name/First",
    MiddleName AS "Person/Name/Middle",
    LastName AS "Person/Name/Last",
    EmailAddress AS "Person/Email"
    FROM Person.Person p
    INNER JOIN Person.EmailAddress e
    ON p.BusinessEntityID = e.BusinessEntityID
    INNER JOIN Person.PersonPhone pp
    ON p.BusinessEntityID = pp.BusinessEntityID
    FOR XML PATH('ElementName'),ROOT('RootName');
    replace ElementName and RootName with whatever name you need to set for element as well as the root element
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • UCCX 9.0(2) XML question

    I'm teaching myself about SOAP and XML responses for an upcoming project for a self-service application. We have UCCE/ICM UCCX/IPIVR premium licenses. I used the excellent article by Gergely (https://supportforums.cisco.com/document/97736/uccx-8x-really-simple-soap-client-no-custom-jar) with success. Thank you.
    In playing around, I found one of the free web services to use to send the SOAP request and receive a response. After much poking around I finally got something to work and got data successfully. From one of the services I used (cydne.com) I was able to get a response XML file, parse the response data and separate it into the various variables I created to receive the data. No problems there.
    However, when I used the service www.webservicex.net, the resulting XML response doesn't have < and > in many of the fields. Instead, it has &lt; and &gt;. I figured I could just do a string replace and replace the &lt; with < and &gt; with >. After I got the response in the soapResponseString variable, I did a Do statement to replace the string &lt; with < and &gt; with >.
    Do:
    soapResponseString = soapResponseString.replace("&lt;","<");
    soapResponseString = soapResponseString.replace("&gt;",">");
    The substitution looked fine and the strings were replaced appropriately. However, when I did create XML document step using (Document)soapResponseString for some reason instead of the string showing TEXT[soapResponseString text goes here] it shows as §com.cisco.wf.steps.io.XMLDocument§com.cisco.wf.steps.io.XMLDocument@0§ . Then, the Get XML Document Data step fails with:
    XML Parser Exception: Nested exception is:
    org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed; nested exception is:
    com.cisco.wf.steps.io.SAXIOException: XML Parse exception; nested exception is:
    org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL] is not allowed.
    The replace does something to the soapResonseString string the Create XML Doucment step [(Document)soapResponseString] doesn't like for some reason and I can't figure out what. I don't need the data from the web service for anything other than testing to verify I can successfully get SOAP data. I'm wondering what the string replacement step does to the original string causing the parsing error. It's not apparently obvious what, if anything, changed.
    I attached a text document with the soapResponseString before string replacement, the Document soapResponseDocument before the replacement, the soapResponseString after replacement and the Document soapResponseDocument after replacement.
    Any insight would be appreciated.
    Bill

    Bill,
    could you please post the WSDL of the webservicex.net service you're trying to use? Is it "Global Weather"?
    If so, I took a look at the request/response pair and the XML they're sending is valid. But it's a bit different from what I am able to see in the text attachment posted by you.
    This is the request:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET">
       <soapenv:Header/>
       <soapenv:Body>
          <web:GetWeather>
             <!--Optional:-->
             <web:CityName>Wien</web:CityName>
             <!--Optional:-->
             <web:CountryName>Austria</web:CountryName>
          </web:GetWeather>
       </soapenv:Body>
    </soapenv:Envelope>
    And this is the response:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soap:Body>
          <GetWeatherResponse xmlns="http://www.webserviceX.NET">
             <GetWeatherResult><![CDATA[<?xml version="1.0" encoding="utf-16"?>
    <CurrentWeather>
      <Location>Wien / Schwechat-Flughafen, Austria (LOWW) 48-07N 016-34E 190M</Location>
      <Time>Dec 19, 2014 - 12:50 AM EST / 2014.12.19 0550 UTC</Time>
      <Wind> from the W (270 degrees) at 16 MPH (14 KT) (direction variable):0</Wind>
      <Visibility> greater than 7 mile(s):0</Visibility>
      <SkyConditions> partly cloudy</SkyConditions>
      <Temperature> 57 F (14 C)</Temperature>
      <DewPoint> 44 F (7 C)</DewPoint>
      <RelativeHumidity> 62%</RelativeHumidity>
      <Pressure> 30.00 in. Hg (1016 hPa)</Pressure>
      <Status>Success</Status>
    </CurrentWeather>]]></GetWeatherResult>
          </GetWeatherResponse>
       </soap:Body>
    </soap:Envelope>
    Now what we can see here is perfectly legal, however, a sane person would never do this (I mean embedding a complete XML (with a header) into an XML. I mean, you can do that with enclosing the embedded XML with a CDATA tag, but again, the XML parser needs to take extra care and the programmer of the web service data consuming application needs to make extra effort to parse this.
    This is an exception to the rule I guess so it can be safely ignored.
    Anyway, can you double check the response string. Or, actually, would you mind posting your script?
    G.

  • Xml search for specific node/attribute

    Hi,
    I load an xml in as3 and need to find and output (as an
    XMLList) a specific node with a specific attribute (example:
    <xs:element name="abcd"> ), or at least find out its path
    (after, I would know what to do to get the XMLList). I looked at
    the XPath classes for Actionscript but the documentation is very
    poor and I did not see any method doing this. Could someone help me
    please? If no method exists, how can I loop through all the xml and
    test each node to see if it is the proper node I am looking for?
    thanks so much in advance for your help
    Pierrot

    You could do it this way, using the descendant accessor:
    var xml:XML =
    <data xmlns:xs="
    http://www.w3.org/2001/XMLSchema">
    <xs:element name="abcd">
    <tagA>hjfhsldf</tagA>
    <tagB>dummy stuff</tagB>
    </xs:element>
    <xs:sequence>
    <xs:element name="dd">
    <tagA>words</tagA>
    <tagB>dummy stuff too</tagB>
    </xs:element>
    </xs:sequence>
    </data>;
    var xs:Namespace = xml.namespaceDeclarations()[0];
    var nodelist:XMLList = xml..xs::element.(@name=="dd");
    trace(nodelist)
    If you need generic code that accounts for no namespaces, you
    can use
    something like this:
    var xs:Namespace = xml.namespaceDeclarations()[0];
    var nodelist:XMLList =
    (xs == null || xs == undefined)
    ? xml..element.(@name=="dd");
    : xml..xs::element.(@name=="dd");
    trace(nodelist)

  • Read CLOB and parse out records

    I have a table that features an XMLTYPE column containing CLOB data with XML and HTML content in it. I'm not quite sure how I can parse out the [CDATA] section and create a unique list of IDs contained within the javascript:openLink() string. Any ideas? I've tried searching the forums for how to read a CLOB and parse out each line, but didn't find the results I was looking for.
    I've provided a sample of some of the content in this column:
    <html><![CDATA[
    <P>
    <font face="Arial" SIZE="3">
    <strong>
    <span style="FONT-FAMILY: Arial">Recruiting</span>
    </strong>
    </font>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1010)">2008 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1009)">2007 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1008)">2006 Newsletters</A>
    </P>
    ]]></html>
    I basically need to output a list of IDs:
    LinkID
    1010
    1009
    1008

    Sorry...I thought I could figure things out based on your example, but I 'm not sure if 10g supports noentityescaping clause. Do you happen to know what I would need to substitute it with? To my understanding the XMLELEMENT function takes a name for "identifier," although I'm not quite sure in this case what the identifier should be...an XML tag value?
    This is SQL I tried to run but not getting any results:
    SELECT t2.*
    FROM (SELECT pagecontent
    FROM tb_rh_page
    WHERE pageid = 1) T,
    XMLTABLE('a/@href' PASSING XMLELEMENT(noentityescaping, EXTRACTVALUE(T.pagecontent,'/p_PAGECONTENT/Controls/divTopLeft/html/text()')).EXTRACT('//a')
    COLUMNS linkid integer PATH 'ora:replace(.,"[^[:digit:]]","")') t2
    Also the HTML is a little deeper in the XML than I originally posted, so I'm not sure if I'm getting to the path correctly.
    Here's what the data looks like in the column:
    <p_PAGECONTENT>
    <PageName/>
    <Title/>
    <Roles/>
    <Controls>
    <PageTool>
    <visible>false</visible>
    </PageTool>
    <divTopLeft>
    <visible>true</visible>
    <style>font-size:larger;overflow:auto;FILTER: progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#3b6f9f, EndColorStr=#e6eff6);Height:560px;background-color:#003366;border-bottom-width: 1px;border-color: #c6ddf1;border-left-width: 1px;border-right-width: 1px;border-style: Solid;border-top-width: 1px;</style>
    <html><![CDATA[
    <P>
    <font face="Arial" SIZE="3">
    <strong>
    <span style="FONT-FAMILY: Arial">Recruiting</span>
    </strong>
    </font>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1010)">2008 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1009)">2007 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(2008)">2006 Newsletters</A>
    </P>
    ]]></html>
    </divTopLeft>
    <divTopRight>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divTopRight>
    <divBottomLeft>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divBottomLeft>
    <divBottomRight>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divBottomRight>
    </Controls>
    </p_PAGECONTENT>

  • HowTo Set the xml-stylesheet processing instruction node?

    Hi,
    Can anyone tell me via PLSQL XMLDOM object what method or attribute to set or howto specify the xml-stylesheet value at the time of generation of the xml document?
    eg
    <?xml version = '1.0'?>
    <?xml-stylesheet type="text/xsl" href="reporthtml.xsl"?>
    <Report>
    <Title>ABC Report</Title>
    </Report>
    Currently my XML just comes out as
    <?xml version = '1.0'?>
    <Report>
    <Title>ABC Report</Title>
    </Report>
    and I want to add the stylesheet reference....
    <?xml-stylesheet type="text/xsl" href="reporthtml.xsl"?>
    Any help is appreciated...

    A COTS product builds the XML and inserts the respective xsl (xml:stylesheet) file name to be used for transforming the xml. I am trying to interrupt this xml and make some updations on an element and finally send the updated xml to the stream.
    For the above process, I parse the input XML using DOMParser and update the elements (some internal elements). While I view the final XML that would be passed to the stream, I found the <?xml-stylesheet... PI is missing.
    I somehow managed using a temp fix by doing the below. I manually pulled the PI using document.getFirstChild().getNodeValue() and reconstructed the PI and inserted it to the outgoing XML. This needs to be done every time. This might run into problems when more than one PI is used in the XML.
    If the parsed XML could get the PI along with it the above problem could be resolved.
    Is there any property that could be set on the parser (prior to parsing) to resolve the issue?.

  • Append to XML remains greyed out

    Hi folks,
    I am using MII 15.0 SP2 Patch 8. I created a new transaction having a xML transcation variable called "test" defined as you cans ee in below screenshot. It is a plain XML having a root node called options.
    Thereafter I created a new transaction adn placed an assignment block there. I treid to use append XML link type to extend my transaction variable. Unfortunately, when trying to append some new xml to test{/OPTIONS}, append XML functions remain greyed out...see screenshot below
    Any idea why that happens? Thanks for your help!

    Hi Anuji, thanks for your answer, u r right. But what if I do not want to choose some value from menue? My plan was to define a new XML segment as string in Expression Editor and append it to my XML. Does that mean this is not possible?
    I somehow need to build a multiline XML looking like this:
    <option>
    <item><text>content...</text></item>
    <item><text>content...</text></item>
    <item><text>content...</text></item>
    <option>
    Content should define a multiline "where clause". Eventually, I want to map resulting XML to options input section of RFC_READ_TABLE to query data from ERP using JCO connector.
    What's a suitable approach to get there?
    Greetings, Marco

  • How to retain prolog in output xml after parse the input xml

    Hi,
    I am using com.bea.xml.XmlObject.Factory.parse(String) method to parse a xml.
    Input XML is having prolog defore the root node.But after parse the xml using the above method, the prolog is not there in the Output XML.
    can any one help me to retain the prolog in Output XML as it is in Input XML......
    Thanks in advance..
    Regards,
    Deba

    Hi,
    The Input XML is like
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    But after parse the Output XML become
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    But due to project requirement i want to keep the prolog(<?xml version="1.0" encoding="UTF-8"?>) as it is with Output XML after parse the xml.
    can i use any XMLOption while calling parse() method...Or any one have any otherway to retain prolog after parse ?
    please help me to get it .
    Thanks in advance.
    Regards,
    Deba

  • Where to ask XML-questions

    Hello,
    when I have a question about XML, where do I ask?
    XML DB issues related to XML DB
    XML  space for the following subspaces
    General XML  Discussion of the general XML language, standards (XSLT, XQuery, XMLSchema, etc.) and application management issues, suggestions and tips.
    PL/SQL XML Programming  PL/SQL programming using XDK and related management issues inside Oracle database server. Any question for XML DB functionality, please post your question in Products -> Database-> XML DB.
    XQuery Discussion of Oracle XQuery Technology Preview, W3C XQuery specifications, and JSR 225: XQuery API for Java (XQJ) issues
    I think I now have an idea (not that I'm sure about it) where my question will fit best. Now, because there is an explanation of the scope of the space, I don't remember something like this in the old forum. Nevertheless it might be confusing for a new member or one that lacks a certain knowledge about the subtleties:
    One step forward everyone who understands the explanation for the PL/SQL XML Programming space!
    When I have a question about XQuery, how can I decide whether XQuery is correct or General XML?
    Which questions qualify for XML DB and not for any of the others.
    We all know that many users are not able to see that SQL questions don't belong into the SQL Developer space, how can we expect that they will find the "correct" forum for XML questions? In the end they will end up in the SQL and PL/SQL space anyhow :-)
    Regards
    Marcus

    My $0.02.
    As I recall, the explanation for each forum was at the entry level for each forum and not displayed within the forum itself.
    The PL/SQL XML Programming space refers to the Oracle XML Developer Kit.  It is maintained by a different team than the XMLDB so the need for a separate space for it makes sense.  That said, what it covers is also part General XML and XQuery if you dig into what you can do in the XDK.
    Some questions that would qualify for the XML DB space.
    Anything related to schema registration or downstream of schema registration.  Such as querying/performance/indexes/etc.
    Issues parsing XML via using XMLTable (or XQuery, such as the new XQuery update added in 11.2.0.3) (Yes that can conflict)
    Storage of data in XMLType columns
    I to have always been a bit unclear on the exact division between groups in this XML space.  I see the XQuery space as being a subset of the General XML space.  I watch all three forums, as they are normally low volume and you never know where a question will pop up.  As you have seen, questions often end up in the wrong forum and often General XML gets an influx of questions that should go into the Business Intelligence space as well.  There is no good way right now to start a generic post and let the system suggest forums that the post could go into, based on content or software involved.  That would be a nice touch for the future.

  • IPhone Dev question Parsing Google maps

    Hi I am trying to parse url data from google maps. I want to get a list of businesses.
    I was trying to use the NSXMLParser class but the output of the url is not in xml format.
    I want to parse out the business lists on the left half of this link.
    Thanks
    http://maps.google.com/maps?near=44Oxford+Dr,+Franklin,+MA02038&geocode=&q=bar&f=l&sll=42.070258,-71.446774&sspn=0.007996,0.018475&ie=UTF8 &z=12&ei=YgkLSf70EIz6NYfh4FM&view=text&attrid=#

    "Apple Support Team" aren't here. This forum is for Users to seek help from other Users. It's not a way to talk to Apple.
    No one will say anything officiall, but it's often reported that this is at the request of the Israeli government, for security reasons.
    If there is a security angle to this, then I would not expect any comment.
    If there isn't one - don't you think the Israeli governement would have said something by now?
    Regards
    TD

  • Trying to use XML SAX parser with JDK2 ...

    Hi,
    I'm pretty new to Java.
    I'm trying to write and use java sample using XML SAX parser. I try with XP and XML4J.
    Each time I compile it give me a error message like
    "SAX01.java:23: unreported exception java.lang.Exception; must be caught or declared to be
    thrown
    (new SAX01()).countBooks();
    ^
    Note: SAX01.java uses or overrides a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error"
    For what I found, it seems that "deprecated" mean usage of old classes or methods. What should I do ?
    Wait for the XML parser to be rewrite ? ....
    Thank's
    Constant

    "SAX01.java:23: unreported exception
    java.lang.Exception; must be caught or declared to be
    thrown
    (new SAX01()).countBooks();
    ^Do this
    public static void main(String[] args) throws Exception {
    or do this
         try
                       first part of expression?(new SAX0()).countBooks();
         catch(Exception ex)     
              System.out.println("problem "+ ex);
    Note: SAX01.java uses or overrides a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error"deprecation is just a warning if there are no errors elsewhere in your program it should compile fine, but if you want to find out how to change it do this:
    javac YourClassName.java -deprecation
    then look in the docs for an alternative.

  • How do I reset my apple id security question with out a rescue email

    How do I reset my apple id security question with out a rescue email?

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (101013)

Maybe you are looking for

  • GARAGE BAND disk is too slow. (prepare) (-10001)

    Hi, Im trying to edit some mp3 files in separated tracks in GB on my NEW Macbook Air 2013 with 4gb ram and 128 flash drive, this files are between 170mb and 221 MB, so this message comes on: disk is too slow. (prepare) (-10001) garageband... what can

  • Issue creating qualified tables in MDM 5.5 SP04 Console

    Try the following: 1) Make sure you are using SP04 Patch 1 (Build 5.5.33.13) 2) Unarchieve one of the supplied business content repositories (Eg. Customer, Material, etc). 3) Create a flat lookup table 4) Create a qualified table with only one field:

  • TOC does not include Heading 1

    I try to include the Heading 1 style headers into the TOC. It only shows Chapter and Section. Any idea?

  • BlackBerry won't reboot!

    I rebooted my BlackBerry Curve 8520 yesterday and its now stuck reloading. I pulled the battery out and tried again and it gets stuck loading about 2/3 of the way through the bar. I've connected it to the computer to try and update the software throu

  • I need to change the default email address that gets sent from Firefox.

    When sending emails from an important web app (Highrise) for my business, it defaults to my home email, when my default in Outlook is clearly my work email. I believe this is the fault of Firefox, since every app (Highrise and Outlook) has my default