| Contents > Developing ColdFusion MX Applications > Using XML and WDDX > Using an XML object > Referencing the contents of an XML object |
|
|
|
|
||
Use the following rules when you reference the contents of an XML document object on the right side of an assignment or as a function argument:
CaseSensitive="True" in the cfxml tag, or specify True as a second argument in the XmlNew or XmlParse function that creates the document object.#mydoc.employee.name[1] and #mydoc.employee.name[2].If you omit the array index on the last component of an element identifier, ColdFusion treats the reference as the array of all elements with the specified name. For example, mydoc.employee.name refers to an array of two name elements.
XmlChildren array to specify an element without using its name; for example, mydoc.XmlRoot.XmlChildren[1].myotherdoc.XmlRoot["Type1.Case1"].For example, the following variables all refer to the XmlText value "Almanzo" in the XML document created in A simple XML document:
mydoc.XmlRoot.XmlChildren[1].XmlChildren[1].XmlText mydoc.employee.name[1].first.XmlText mydoc.employee.name[1]["first"].XmlText mydoc["employee"].name[1]["first"].XmlText mydoc.XmlRoot.name[1].XmlChildren[1]["XmlText"]
The following variables all refer to the EmpType attribute of the first name element in the XML document created in A simple XML document:
mydoc.employee.name[1].XmlAttributes.EmpType mydoc.employee.name[1].XmlAttributes["EmpType"] mydoc.employee.XmlChildren[1].XmlAttributes.EmpType mydoc.XmlRoot.name[1].XmlAttributes["EmpType"] mydoc.XmlRoot.XmlChildren[1].XmlAttributes.EmpType
Neither of these lists contains a complete set of the possible combinations that can make up a reference to the value or attribute.
|
|
||
| Contents > Developing ColdFusion MX Applications > Using XML and WDDX > Using an XML object > Referencing the contents of an XML object |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.