Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

isValid('xml', myXML) BUG!

Explorer ,
Sep 03, 2008 Sep 03, 2008
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>
555
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 03, 2008 Sep 03, 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
Translate
LEGEND ,
Sep 03, 2008 Sep 03, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 03, 2008 Sep 03, 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 03, 2008 Sep 03, 2008
LATEST
> 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.

Yep, it is weird. It might have been some functionality that was going to
go into CF at some stage, but didn't get finished, but equally wasn't
removed either. And I suppose the CFEclipse bods thought the functionality
is in there. Or they could be parsing some internal CF function list to
create their helpers, not realising that one wasn't supposed to be exposed.

Still: it dun't work, and probably isn't supposed to, which is the crux of
the matter.

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 03, 2008 Sep 03, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 03, 2008 Sep 03, 2008
I think you need to look at XmlParse() or XmlValidate()
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=XML_14.html#1132552
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources