- see footer for list info -<
I'm reading up on XML and playing around with some XPath stuff in CF. I am
trying to use the text() location step to get at just the xmlText of the
element I am searching for, e.g.

aResults = XMLSearch(myXML,'myroot/myelement/text()');

This produces an array of objects of 'unknown type'. I do like this...

<cfdump var="#aResults[1].GetClass().GetName()#">

...and see that the object's class is "*org.apache.crimson.tree.TextNode*".
I then look this up on t'internet and eventually find an inherited method
called GetData() which returns the string. So:

aResults = XMLSearch(myXML,'myroot/myelement/text()');
for(i=1; i LTE aResults.size(); i=i+1)
     WriteOutput(aResults[i].GetData());

Surely this is lunacy?! Is there another way to get at the XMLText with
XPath without having to loop?

Thanks in advance,

Dom
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to