Re: Avoiding boneheaded mistakes in XSLT?
Still ignoring schema. My supposition is that *for the xml instance being processed* either the expression will or will not return a non-empty sequence. Hence there is a possible error. In this case either the first book child has an author child or not. Surely that information is available Mike?
The problem is that if someone writes
if (@version = "2.0") ...
and there is no @version attribute, it's very likely that the semantics of the vocabulary are that an absent version attribute is to be treated as if @version="1.0". So a warning that there is no version attribute would be inappropriate here. The situation where the schema doesn't allow a version attribute is different.
Michael Kay Saxonica
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format