Whatever message this page gives is out now! Go check it out!
XmlChildPos(node, childName, index)Parameter | Description |
node | XML element within which to search. |
childName | XML child element for which to search. Must be an immediate child of the node parameter. |
index | Index of XMLchild element for which to search. |
<!--- Create an XML document object --->
<cfxml variable="xmlobject">
<employee>
<!-- A list of employees -->
<name EmpType="Regular">
<first>Almanzo</first>
<last>Wilder</last>
<Status>Medical Absence</Status>
<Status>Extended Leave</Status>
</name>
<name EmpType="Contract">
<first>Laura</first>
<last>Ingalls</last>
</name>
</employee>
</cfxml>
<!--- Find the second Status child of the first employee.name element --->
<cfscript>
elempos=XMLChildPos(xmlobject.employee.name[1], "Status", 2);
ArrayDeleteAt(xmlobject.employee.name[1].XmlChildren, elempos);
</cfscript>
<!--- Dump the resulting document object to confirm the deletion --->
<cfdump var="#xmlobject#">