Yeah, this does work:

<cfxml variable="xmlData">
        
        <root>
                <a1>Meep</a1>
                <a2>Meep</a2>
                <a3>
                        <b1>Dink</b1>
                        <b2>Meep</b2>
                </a3>
                <a4>Blam</a4>
        </root>

</cfxml>


<cfset arrNodes = XmlSearch( xmlData, "//*[ text() = 'Meep' ]" ) />

<cfdump var="#arrNodes#" /> 

Gets any node with value = "Meep".


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Ben Nadel [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 24, 2007 4:28 PM
To: CF-Talk
Subject: RE: xpaths and regex

Brad,

You can use * for the node name, but not sure about any regular
expressions. If you are interested, I just wrote an introductory
tutorial on Xpath in XmlSearch() and I don't remember seeing anything
about RegEx as I was learning:

http://www.bennadel.com/index.cfm?dax=blog:827.view

If you are looking for a value-based node, you might be able to rock
something like:

//*[ text() = 'TARGET_TEXT' ]

Not sure if you can use Text() predicate in conjunction with a * wild
card - haven't tried it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

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

Reply via email to