Created
March 4, 2014 18:49
-
-
Save twelverobots/9353023 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfxml variable="myXML"> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<data> | |
<users> | |
<user> | |
<name>Bill</name> | |
</user> | |
<user> | |
<name>Dave</name> | |
</user> | |
<user> | |
<name>Harry</name> | |
</user> | |
</users> | |
</data> | |
</cfxml> | |
<cfset users = xmlSearch(myXML, "//user") /> | |
<cfloop array="#users#" index="userIndex"> | |
<cfset user = xmlSearch(userIndex, "//name") /> | |
<cfoutput> | |
XMLSearch found #arrayLen(user)# <name> elements in this XML : #encodeForHTML(toString(userIndex))#<hr /> | |
<br /> | |
</cfoutput> | |
</cfloop> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment