Peter J. Farrell said the following on 09/29/2010 06:11 PM:
<cfhttp
url="http://www.technicalsynergy.com/XMLSample/fedExSample.xml" />
<cfset returnXml = XmlParse(cfhttp.fileContent) />
<cfset step1 = XMLSearch(returnXML,
"//*[local-name()='StringBarcodes']").get(0) />
<cfset step2 =
XMLSearch(step1,".//*[local-name()='Type']").get(0).xmlText />
<cfdump var="#variables.step1#"/>
<cfdump var="#variables.step2#"/>
BTW, I decided to dig a little further (for Google's future sake) and I
tested the above code on ACF8. It works exactly as OpenBD does.
I tried your XPaths from your original email on ACF8 just to be sure
there wasn't a compatibility issue. I did correct case-sensitive issue
with "StringBarcodes". Even with the correction, ACF throws an
exception. It's acting the same as OpenBD did.
So I don't think it's a bug with XMLSearch() itself nor a CFML engine
compatibility issue either.
I hope my original email makes sense why the XPath didn't work.
W3Schools has a nice reference guide that I use a lot to keep things
straight:
http://www.w3schools.com/XPath/xpath_syntax.asp
And local-name() reference:
http://www.stylusstudio.com/docs/v62/d_xpath12.html#wp1068666
FYI, local-name() "returns the local part of the expanded name of the
node in the node-set argument that is first in document order" (hence
why you were seeing "COMMON_2D" because it was first in the document
order) and if nothing is found then a "" is returned.
HTH,
.pjf
--
Open BlueDragon Public Mailing List
http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon
official manual: http://www.openbluedragon.org/manual/
Ready2Run CFML http://www.openbluedragon.org/openbdjam/
mailing list - http://groups.google.com/group/openbd?hl=en