开发者

Using xPath to find the value of a child node

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜