Whatever message this page gives is out now! Go check it out!
XmlHasChild(xmlObject)XmlHasChild(xmlObject [, childName])| Parameter | Description |
| xmlObject | The XML document object to be checked for child nodes. |
| childName | The name of the child node to check if it exists. |
<cfxml variable="xmlData">
<root>
<item id="1">Item 1</item>
<item id="2">Item 2</item>
<item id="3">Item 3</item>
</root>
</cfxml>
<cfscript>
writeDump(xmlData)
writeOutput("<br/>")
writeOutput(xmlHasChild(xmlData)) // YES
</cfscript><cfxml variable="xmlData">
<root>
<item id="1">Item 1</item>
<item id="2">Item 2</item>
<item id="3">Item 3</item>
</root>
</cfxml>
<cfscript>
writeDump(xmlData)
writeOutput("<br/>")
writeOutput(xmlHasChild(xmlData,"root")) // YES
writeOutput("<br/>")
writeOutput(xmlHasChild(xmlData,"item")) // NO
</cfscript>