Select a xml node with specific xmlText and attribute value in coldfusion



I have a XML document and this is the node I want to select:


enter image description here


Initially I tried to select it with its attribute ID as and it works fine:



<cfset local.XML = xmlParse(filePath)>
<cfset local.header = xmlSearch(
local.XML,
"/FILE/COLUMNS/HEADER[@ID = 1051]"
)>


I am now trying to select this xml node with its xmlText as:



<cfset local.header = xmlSearch(
local.XML,
"/FILE/COLUMNS/HEADER[text() = '4079']"
)>


But I am not able to select this node with its text. What am I doing wrong? And is it possible to select a node with specific attribute value and text in single statement?


Please help. Thanks in advance.


No comments:

Post a Comment