Whatever message this page gives is out now! Go check it out!

XmlDelete

Last update:
May 18, 2026

Description

Deletes a specified node.

Returns

None

Category

Syntax

XmlDelete(xmlObject,childName)

Parameters

ParameterDescription
xmlObjectThe XML document object.
childNameThe child node or nodes in the XML object to be deleted.

Example

<cfxml variable="xmlData">
  <root>
    <item id="1">Item 1
        <route>Route 1</route>
        <route>Route 2</route>
    </item>
    <item id="2">Item 2</item>
    <item id="3">Item 3</item>
  </root>
</cfxml>

<cfscript>
    writeDump(xmlData)
    XmlDelete(xmlData.root.item,"route")
    writeOutput("<br/>" & "Delete all child nodes for item id=1" & "<br/>")
    writeDump(xmlData)
</cfscript>

Try in CFFiddle

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page