Yay for XPath 2, that's good news.  Just today I was wrestling with
XSLT that needed a Replace function which XPath 2 supports but XPath 1
(for some reason) does not. What kind of language doesn't have a
Replace function?

Cheers,
Judah

On Wed, Dec 7, 2011 at 2:03 PM, Raymond Camden <[email protected]> wrote:
>
> Actually, you want to limit yourself to these - since CF9 is still
> xpath1 (Zeus is adding xpath2)
>
> http://en.wikipedia.org/wiki/XPath_1.0
>
>
> On Wed, Dec 7, 2011 at 3:56 PM, Raymond Camden <[email protected]> 
> wrote:
>> You can use functions to get values:
>>
>>
>>
>> <cfxml variable="test">
>> <employee>
>>  <startDate>09-09-2009</startDate>
>> </employee>
>> </cfxml>
>>
>> <cfset r = xmlSearch(test, "string(//employee/startDate)")>
>> <cfdump var="#r#">
>>
>> Docs: http://www.w3schools.com/xpath/xpath_functions.asp#string
>>
>> On Wed, Dec 7, 2011 at 3:23 PM, Dominic Watson
>> <[email protected]> wrote:
>>>
>>> It's getting old in the tooth and could do with some JavaLoader love,
>>> but this project can help with that sorta thing:
>>>
>>> http://betterxml.riaforge.org
>>>
>>> Dominic
>>>
>>> On 7 December 2011 21:09, Christophe Maso <[email protected]> wrote:
>>>>
>>>> Is there any way to get the "09-09-2009" string using xmlSearch() for the 
>>>> below xml?
>>>>
>>>> <employee>
>>>>   <startDate>09-09-2009</startDate>
>>>> </employee>
>>>>
>>>> I've been doing something like this, which is a real pain:
>>>>
>>>> arrDate = xmlSearch(xml, "//employee/startDate");
>>>> strDate = arrDate[1].XmlText;
>>>>
>>>> It seems that xmlSearch() must always return an array and is unable to 
>>>> return a string, which makes sense, but using the above code has gotten 
>>>> old, real fast.
>>>>
>>>>
>>>
>>>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349016
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to