IsXML
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
Determines whether a string is well-formed XML text.
IsXML(value=[any])
value
any
true
A string containing the XML document text.
Returns true if the string is well-formed XML.
example = "<boxlangengines>
<engine>
<name>Adobe ColdFusion</name>
</engine>
<engine>
<name>Boxlang</name>
</engine>
<engine>
<name>Railo</name>
</engine>
<engine>
<name>Open BlueDragon</name>
</engine>
</boxlangengines>";
writeOutput( isXml( example ) );
Result: true
Returns false if the string is not well-formed XML.
example1 = "<boxlangengines>
<engine>
<name>Adobe ColdFusion</name>
</engine>
<engine>
<name>Boxlang</name>";
writeOutput( isXml( example1 ) );
Result: false
globalVar = "<Earth>
<required>
<name>Trees</name>
</required>
<required>
<name>Water</name>
</required>
<required>
<name>Agriculture</name>
</required>
<required>
<name>Humanity</name>
</required>
</Earth>";
writeOutput( isXml( globalVar ) );