>
> How would I use this second name space in a ColdFusion xmlSearch()
> function?


This is a tricky one. For xslt, what you are doing there is mapping any
namespaces in the target xml with a prefix. From then on, using the prefix
in your xslt will work great. For XmlSearch however, there is no ColdFusion
tool for mapping namespaces to prefixes so you can only use the ':' default
namespace prefix. If you have more than one default namespace in your xml,
you are left without a paddle (using ':' won't work).

Enter betterXml. I have made a couple of components to utilize xpath better
in coldfusion (mainly for maintaining xml files but useful in other
situations). The xmlReader component has a MapNamespace method that does
what it says on the tin. You could do:

oXml = createObject('component', 'betterXml.betterXmlReader').init(xmlFile);
oXml.MapNamespace('http://www.w3.org/1999/xhtml', 'xHtml');

aXPathSearchResults = oXml.Search('//xHtml:

Check out my blogpost on this:

http://fusion.dominicwatson.co.uk/2008/03/xmlsearch-and-default-namespaces.html

The project is on riaforge:

http://betterxml.riaforge.org

HTH

Dominic

-- 
Blog it up: http://fusion.dominicwatson.co.uk


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305185
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to