Skip to main content
Inspiring
September 3, 2008
Answered

isValid('xml', myXML) BUG!

  • September 3, 2008
  • 3 replies
  • 648 views
isValid('xml' should return a boolean true/false, but if the xml is bad it throws an error instead. Anyone else have this issue or find a workaround other than using isXML which works?

<cfsavecontent variable="myXML">
<parent>
<child>A&L</child>
</parent>
</cfsavecontent>

<cfoutput>
isXML: #isXML(myXML)#<br>
isValid: #isValid('xml',myXML)#
</cfoutput>
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    Where are you getting the impression that "xml" is an option of isValid()?
    It doesn't say anything about it in the docs:

    http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_in-k_37.html
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00000534.htm

    I'm surprised it's not erroring one th 'xml' bit, rather than the
    [admittedly invalid] XML.

    --
    Adam

    3 replies

    Participating Frequently
    September 3, 2008
    Inspiring
    September 3, 2008
    > Where are you getting the impression that "xml" is an option of isValid()?

    NB: I'm not saying it doesn't (kinda) work / should work, I'm just
    wondering where you read about the option. Either it's undocumented, or
    the docs are wrong (which is slightly different, in my view).

    I'm on the CF9 alpha programme, so if we can tie down a good description of
    the bug / shortfall in the docs / whatever, I can get it raised and
    hopefully fixed.

    --
    Adam
    Newsgroup_UserCorrect answer
    Inspiring
    September 3, 2008
    Where are you getting the impression that "xml" is an option of isValid()?
    It doesn't say anything about it in the docs:

    http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_in-k_37.html
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00000534.htm

    I'm surprised it's not erroring one th 'xml' bit, rather than the
    [admittedly invalid] XML.

    --
    Adam
    NeoRyeAuthor
    Inspiring
    September 3, 2008
    Well, that is interesting. I'm using CFEclipse and one of the drop-down options for isValid is 'xml'. It returns true if it it's valid, just not poorly formed. My mistake since I assumed it was an option based on what Eclipse was telling me and it did seem to work. It is wierd that it seems to try and parse the xml - maybe since it kinda works they'll make it work it 9?