[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: http_parse_xml_stmf issue (missing expected returned content)



Hi Roger,

EXAMPLE17 is an example of a document where one XML tag contained a string. That string contained another XML document. So as sent over the network it would be something like:

<mytag>&lt;mydoc&gt;data here&lt;/mydoc&gt;</mytag>

(Hopefully the formatting of the above doesn't get messed up by the e-mail system). The idea is that an XML tag can contain any data... and that data can, itself, be another XML document (if the special symbols are properly escaped.)

So when HTTPAPI parses the above documnet, it'd call the "end handler" for the mytag tag, and it'd pass "<mydoc>data here</mydoc>" in the value parameter. (the tags are automatically un-escaped by the XML parser, but are not parsed.)

You would then save the output of that "inner" XML document to a variable or file, and then parse it again. EXAMPLE17 demonstrates this entire process.

Your document, however, does NOT contain an XML document that has been embedded inside another XML document. Instead, it's just a very simple XML document containing the values. You, therefore, do not have to jump through these extra hoops. Just save the data you need from the various tags you receive.

hope that helps...

-SK


On 8/27/2012 12:44 PM, Roger Nassar wrote:
    Hi,

    I have an xml  structure like below.

    <?xml version="1.0" encoding="UTF-8"?>

    <soapenv:Envelope
    xmlns:soapenv="[1]http://schemas.xmlsoap.org/soap/envelope/";>

    <soapenv:Body>

                    <ns:cifResponse
    xmlns:ns="[2]http://retxyz.wsbeans.iseries/xsd";>

                        <ns:return>

                                    <ns:_CifId>123</ns:_CifId>

                                    <ns:_Prefix>xyz</ns:_Prefix>

                                    <ns:_RequestID>RI1</ns:_RequestID>


    <ns:_RequestStamp>Stamp1</ns:_RequestStamp>

                                    <ns:_Requestor>Reqstr</ns:_Requestor>

                                    <ns:_RetTab>string</ns:_RetTab>

                                    <ns:_Retcode></ns:_Retcode>

                                    <ns:_Retmsg></ns:_Retmsg>

                                    <ns:_User>Rgr</ns:_User>

                        </ns:return>

    </ns:cifResponse>

    </soapenv:Body>

    </soapenv:Envelope>


    When I use the http_parse_xml_stmf with a routine in the endtag, when I
    get to ns:return name tag, I see nothing in the value.

    Note: In your EXAMPLE17, we clearly see all the tags that are "under"
    that level.

    What am I missing?

    Thanks,

    Roger


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------