Neither of those work either...

Should I strip out certain parts of the results first?

----- Original Message ----- 
From: "Ben Johansen" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, April 25, 2006 4:25 PM
Subject: RE: Witango-Talk: Parsing DOM Response for element by name


> Looks like XPATH has an issue with name spaces.
>
> Have you tried:
> <@elementvalue object=local$packageDOM
>
XPATH="/soapenv:Envelope/soapenv:Body/AddPartnerMessageResponse/Timestamp">
> or
> <@elementvalue object=local$packageDOM XPATH="/
> Envelope/soapenv/AddPartnerMessageResponse/Timestamp">
>
> To force xpath to that level
> Ben
>
> -----Original Message-----
> From: Dave Machin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 25, 2006 3:12 PM
> To: [email protected]
> Subject: Re: Witango-Talk: Parsing DOM Response for element by name
>
> I'm stumped on this, can anyone see what I'm doing wrong?
>
> I make a URL call and receive XML results.  I'm trying to use XPATH as
> described below, but get no results.
>
> The XML returned looks like this:
> <soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>  <soapenv:Body>
>   <AddPartnerMessageResponse xmlns="urn:ebay:apis:eBLBaseComponents">
>    <Timestamp>2006-04-25T21:37:53.484Z</Timestamp>
>    <Ack>Success</Ack>
>    <Version>461</Version>
>    <Build>e461_core_Unified_2718252_R1</Build>
>    <MessageID>2702</MessageID>
>    <MessageID>2703</MessageID>
>   </AddPartnerMessageResponse>
>  </soapenv:Body>
> </soapenv:Envelope>
>
> This command:
> <@elementvalue object=local$packageDOM
> XPOINTER="root().child(1).child(1).child(1)">
>
> Returns 2006-04-25T22:10:32.234Z
>
> But
>
> <@elementvalue object=local$packageDOM XPATH="//Timestamp">
>
> Doesn't return anything
>
> Any ideas?
>
>
> ----- Original Message ----- 
> From: "John McGowan" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Wednesday, April 05, 2006 11:35 AM
> Subject: Re: Witango-Talk: Parsing DOM Response for element by name
>
>
> > Dave,
> >
> > XPATH="//Timestamp"
> >
> > would do the trick.
> >
> > XPath is a lot nicer to use than XPointer.
> >
> > This of course assumes that you're using a version of Witango that
> > supports XPath.  If not, it's time to upgrade.
> >
> > You may run into issues with namespaces.  It might be easier for you to
> > clean out all namespace references before traversing the DOM.
> >
> > /John
> >
> > Dave Machin wrote:
> > > I'm trying to parse a DOM reponse from a web service.  I'm looking to
> find a
> > > particular element in the reponse.  I know the name of the element I
> need,
> > > but I won't always know it's position in the response.
> > >
> > > For example, I receive the following response:
> > >
> > > <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
> > >     <soapenv:Body>
> > >         <GeteBayOfficialTimeResponse
> > > xmlns="urn:ebay:apis:eBLBaseComponents">
> > >             <Timestamp>2006-04-05T18:18:00.547Z</Timestamp>
> > >             <Ack>Success</Ack>
> > >             <Version>461</Version>
> > >             <Build>e461_core_Unified_2718252_R1</Build>
> > >         </GeteBayOfficialTimeResponse>
> > >     </soapenv:Body>
> > > </soapenv:Envelope>
> > >
> > > And I need the <timestamp> element.  I can access it by doing this:
> > >
> > > <@elementvalue object="local$packageDOM"
> > > element="root().child(1).child(1).child(1)">
> > >
> > > But I'd like to be able to reference <timestamp> instead of having to
> know
> > > the root/child relationships.
> > >
> > > Is there an easy way to do this?
> > >
> > > Dave Machin
> > >
> > >
> > >
________________________________________________________________________
> > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
> > >
> > >
> > ________________________________________________________________________
> > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
> >
>
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to