05-18-2006 1:04 AM
Hi,
I am trying to use this method to get to the right xml node. However this does not seem to be working. Does anybody know what I am doing wrong here. Any help is highly appreciated.
CALL METHOD document->find_from_path_ns
EXPORTING
default_uri = 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
path = '/soap:Envelope/soap:Body/child::node()'
receiving
rval = rval1
The xml document looks like this.
<?xml version="1.0" encoding="utf-8"?><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><GetStndAddressResponse xmlns="http://micron.com/AddrStnd/"><GetStndAddressResult><stdAddress>5811 N Cosworth Pl</stdAddress><stdZipCode>83713-1263</stdZipCode><stdState>ID</stdState><stdCity>Boise</stdCity></GetStndAddressResult></GetStndAddressResponse></soap:Body></soap:Envelope>
08-14-2006 10:36 PM
First, your default_uri should be just http://schemas.xmlsoap.org/soap/envelope/.
Second, I do not think the path parameter actually supports XPath syntax, from the documentation it seems to be much simpler than that. Besides, it seems that the default_uri actually works only on the first element in the path, which I believe is a bug.
So something like this should work:
CALL METHOD document->find_from_path_ns
EXPORTING
default_uri = 'http://schemas.xmlsoap.org/soap/envelope/'
path = '/Envelope/"http://schemas.xmlsoap.org/soap/envelope/:Body"/"http://micron.com/AddrStnd/:GetStndAddressResponse"'
receiving
rval = rval1
Notice the full namespace URI in front of the element names and double quotes around each qualified element name.
Full XPath functionality is possible with cl_xslt_processor class (set_expression and RUN( PROGNAME = '' ) methods), but it's kind of an undocumented feature.
08-14-2006 10:36 PM
First, your default_uri should be just http://schemas.xmlsoap.org/soap/envelope/.
Second, I do not think the path parameter actually supports XPath syntax, from the documentation it seems to be much simpler than that. Besides, it seems that the default_uri actually works only on the first element in the path, which I believe is a bug.
So something like this should work:
CALL METHOD document->find_from_path_ns
EXPORTING
default_uri = 'http://schemas.xmlsoap.org/soap/envelope/'
path = '/Envelope/"http://schemas.xmlsoap.org/soap/envelope/:Body"/"http://micron.com/AddrStnd/:GetStndAddressResponse"'
receiving
rval = rval1
Notice the full namespace URI in front of the element names and double quotes around each qualified element name.
Full XPath functionality is possible with cl_xslt_processor class (set_expression and RUN( PROGNAME = '' ) methods), but it's kind of an undocumented feature.