[Project_owners] XPath

Adam Judson adamsplugins at gmail.com
Thu Feb 16 00:20:20 EST 2006


This:

http://www.faqts.com/knowledge_base/view.phtml/aid/34022/fid/119

was the answer.

Though it seems like there should have been an easier way...

A


On 15/02/06, Eric H. Jung <grimholtz at yahoo.com> wrote:
> You'll have to use the namespace-uri() to access the default namespace.
> By the way, if you're doing a lot with XPath, you'll find this very
> useful:
> http://www.topxml.com/xpathvisualizer/
> I asked Ted M. to put this in the Extension Developer's Extension some
> time ago, but he hasn't gotten around to it yet.
>
>
> --- Adam Judson <adamsplugins at gmail.com> wrote:
>
> > A small xpath question:
> >
> > I have the results of a yahoo geocoding transaction:
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > - <ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns="urn:yahoo:maps" xsi:schemaLocation="urn:yahoo:maps
> > http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd">
> > - <Result precision="city" warning="The street could not be found.
> > Here is the center of the city.">
> >   <Latitude>43.670235</Latitude>
> >   <Longitude>-79.386757</Longitude>
> >   <Address />
> >   <City>TORONTO</City>
> >   <State>ON</State>
> >   <Zip />
> >   <Country>CA</Country>
> >   </Result>
> >   </ResultSet>
> >
> >
> > and I want to pull out Latitude
> >
> > this:
> > document.evaluate("//Latitude", root, null, XPathResult.STRING_TYPE,
> > null).stringValue;
> >
> > doesn't work.
> >
> > I suspect the namespace is causing my problems, but as I was unable
> > to
> > solve it in 5 minutes, I decided to defer to others wisdom...
> >
> > Any suggestions?
> >
> > Adam
> > _______________________________________________
> > Project_owners mailing list
> > Project_owners at mozdev.org
> > http://mozdev.org/mailman/listinfo/project_owners
> >
>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>


More information about the Project_owners mailing list