xsl-list
[Top] [All Lists]

Re: [xsl] Avoiding boneheaded mistakes in XSLT?

2010-12-30 07:53:52

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--