Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml parsing

Status
Not open for further replies.

jimmyshoes

Programmer
Jun 1, 2008
132
GB
I am trying to parse the xml from a pdf file. I have used the following to get the xml
Code:
<CFSet xmlDoc = XMLParse(toString(output))>

I want to search the xml for a specific node called <xap:ModifyDate> . How is this best achieved?
 
If you know the heirarchy, you can use XmlSearch.

This is from the CF docs:


The employeesimple.xml file contains the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<employee>
<!-- A list of employees -->
<name EmpType="Regular">
<first>Almanzo</first>
<last>Wilder</last>
</name>
<name EmpType="Contract">
<first>Laura</first>
<last>Ingalls</last>
</name>
</employee>

The CFML file contains the following lines:

<cfscript>
myxmldoc = XmlParse("C:\CFusionMX7\ selectedElements = XmlSearch(myxmldoc, "/employee/name/last");
for (i = 1; i LTE ArrayLen(selectedElements); i = i + 1)
writeoutput(selectedElements.XmlText & "<br>");
</cfscript>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top