View Single Post
  #3 (permalink)  
Old August 23rd, 2006, 04:21 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I think the adjective "well-formed" is rather unfortunate, because talking about "testing XML to see if it is well-formed" suggests that there can be XML that isn't well-formed. In fact all XML is well-formed, if it's not well-formed then it isn't XML.

The way to test whether an input file contains well-formed XML is to try parsing it with an XML parser, and if you get an error then it isn't.

XSLT and XPath can only process well-formed XML. If the input isn't well-formed you'll get an error from the XML parser long before the XSLT or XPath processor kicks in.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote