Thanks Adrian. I tested out both the examples, and the one that works best is var e = XPath.selectNodesAsNumber(this,"/weather/dayf/[EMAIL PROTECTED]'3']/[EMAIL PROTECTED]'d']/icon/text()");
For some reason the one that should work and Won't work is var e = XPath.selectNodes(this,"/weather/dayf/[EMAIL PROTECTED]'3']/[EMAIL PROTECTED]'d']/icon/text()"); e = String( e.firstChild.nodeValue ); I wonder why.. But I like the first example which works and thanks so much for looking into it. Chaitu. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wade Arnold Sent: Saturday, March 11, 2006 3:17 PM To: Flashcoders mailing list <flashcoders@chattyfig.figleaf.com>; Adrian Park Subject: Re: [Flashcoders] XPath problems with single character value nodes Thanks Adrian for following up on this. We are having issues with parsing the content feed from the weather.com api. http://www.t8design.com/personal/chaitu/Weather/weather_proxy.php?id=USIA088 5 On 3/11/06 10:58 AM, "Adrian Park" <[EMAIL PROTECTED]> wrote: > I've done some investigation on nthis issue and found this... > > If you modify your path like this (note the /text() at the end) you should > get the value correctly... > > var e = XPath.selectNodesAsString > (this,"/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL > PROTECTED]'d']/icon/text()"); > > > Interestingly, if you try this it won't work... > > var e = XPath.selectNodesAsNumber > (this,"/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL > PROTECTED]'d']/icon/number()"); > > ...but this does... > > var e = XPath.selectNodesAsNumber > (this,"/weather/dayf/[EMAIL PROTECTED]'4']/[EMAIL > PROTECTED]'d']/icon/text()"); > > This final example actually returns a Number (not a String as the first > example does) which is what I guess you'd want to get from the <icon> > element but seems to do it the wrong way (using text() )! > > I'm going to report this info to Xfactor Studio. > > Hope this is helpful. > A. > > On 3/11/06, erixtekila <[EMAIL PROTECTED]> wrote: >> >> >> Le 11 mars 06, à 11:27, Adrian Park a écrit : >> >>> I encountered exactly the same issue on the project I'm currently >>> working >>> on. I got around the problem by using XPath.selectNodes rather than >>> XPath.selectNodesAsString. >> Please send a mail to XPath author to get this fixed. >> ----------- >> erixtekila >> http://blog.v-i-a.net/ >> _______________________________________________ >> Flashcoders@chattyfig.figleaf.com >> To change your subscription options or search the archive: >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> Brought to you by Fig Leaf Software >> Premier Authorized Adobe Consulting and Training >> http://www.figleaf.com >> http://training.figleaf.com >> > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com