Determines whether a string is well-formed XML text.
isXML(value)
→ returns boolean
Returns true if the string is well-formed XML.
example = '<coldfusionengines>
<engine>
<name>Adobe ColdFusion</name>
</engine>
<engine>
<name>Lucee</name>
</engine>
<engine>
<name>Railo</name>
</engine>
<engine>
<name>Open BlueDragon</name>
</engine>
</coldfusionengines>';
writeOutput( isXml( example ) );
Expected Result: true
Returns false if the string is not well-formed XML.
example1 = '<coldfusionengines>
<engine>
<name>Adobe ColdFusion</name>
</engine>
<engine>
<name>Lucee</name>';
writeOutput( isXml( example1 ) );
Expected Result: false
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.