Whatever message this page gives is out now! Go check it out!
ATTRIBUTE_NODE | CDATA_SECTION_NODE |
COMMENT_NODE | DOCUMENT_FRAGMENT_NODE |
DOCUMENT_NODE | DOCUMENT_TYPE_NODE |
ELEMENT_NODE | ENTITY_NODE |
ENTITY_REFERENCE_NODE | NOTATION_NODE |
PROCESSING_INSTRUCTION_NODE | TEXT_NODE |
XmlGetNodeType(xmlNode)Parameter | Description |
xmlNode | An XML DOM object node |
<!--- Create an XML document object --->
<cfxml variable="xmlobject">
<?xml version="1.0" encoding="UTF-8"?>
<order id="4323251">
<customer firstname="Philip" lastname="Cramer" accountNum="21"/>
<items>
<item id="43">
<!-- This item is coded to show several node types -->
<![CDATA["Our Best" hammer & chisel set!!!]]> Imported from France
<quantity>1</quantity>
<unitprice>15.95</unitprice>
</item>
</items>
</order>
</cfxml>
<!--- Display the node types --->
<cfoutput>
<h3>Node Types</h3>
xmlobject: #XMLGetNodeType(xmlobject)#<br>
xmlobject.order: #XMLGetNodeType(xmlobject.order)#<br>
<br>
Now check the types of all the nodes in the xmlobject.order.items.item
element's XmlNodes array.<br>
Note the many apparently empty Text nodes generated by whitespace characters in the XML text source.<br><br>
<cfset descnodes=xmlobject.order.items.item.XmlNodes>
<cfloop from="1" to="#ArrayLen(descnodes)#" index="i">
#i# Node type is: #XMLGetNodeType(descnodes[i])#<br>
#i# Node name is: #descnodes[i].XmlName#<br>
<cfif (descnodes[#i#].XmlValue NEQ "")>
#i# Node value is: #descnodes[i].XmlValue#<br>
</cfif>
<br>
</cfloop>
</cfoutput>