XmlChildPos

Description

Gets the position of a child element within an XML document object.

Return value

The position, in an XmlChildren array, of the Nth child that has the specified name.

Category

Extensibility functions, XML functions

Syntax

XmlChildPos(elem, childName, N)  

See also

cfxml, IsXmlDoc, XmlChildPos, XmlFormat, XmlNew, XmlParse, XmlSearch, XmlTransform

History

New in ColdFusion MX: this function is new.

Parameters

Parameter Description
elem
XML element within which to search
childName
XML child element for which to search
N
Index of XMLchild element for which to search

Usage

The returned index can be used in the ArrayInsertAt and ArrayDeleteAt functions.

Example

This example searches the XML document object mydoc.employee.XmlChildren for the mydoc.employee.name[2] element:

XmlChildPos(mydoc.employee, "name", 2) 

Comments