开发者

Using xPath to find the value of a child node

开发者 https://www.devze.com 2023-01-14 23:16 出处:网络
I am using xPath to do some ETL work from a dictionary lookup file. I need to be able to look for the translation key and return the translated value. For example I need to be able to look for \"prior

I am using xPath to do some ETL work from a dictionary lookup file. I need to be able to look for the translation key and return the translated value. For example I need to be able to look for "prioremployment" and have it return "Prior Employment".

This will return an array of all the translate nodes (I am using ColdFusion 9):

XMLSearch(xmlDoc, "//translate")

Here is the XML I am working with:

<dictionary>
 <category value="additionalinfo">
        <translate value=开发者_开发知识库"prioremployment">Prior Employment</translate>
 </category>
 <category value="bilingualnarratives">
    <translate value="narr_priorexpLOT">Prior Bilingual Experience</translate>
 </category>
 <category value="certification">
    <translate value="cell_phonehours">Cell Phone Hours</translate>
    <translate value="dlexp">Driver's License Exp. Date</translate>
 </category>
</dictionary>


This?

//translate[@value='KEY']
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号