You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by il...@ca.ibm.com on 2002/07/24 16:18:37 UTC

Attribute validation in Xalan

Hello,

There have been a few bug reports related to attributes that aren't getting
validated (see 792, 793, 5013 for details).    There were a number of
symptoms occuring when some attributes were not being validated, including:

   unexpected or incorrect output
   exceptions without comprehensive message text

Recently, I created a patch so that  attributes are validated statically
(before runtime) wherever AVT's are not used.   I was just looking through
the patch, and the XSLT 1.0 spec and I realized that in many cases, I
allowed warnings (and attempted recovery), where errors really should have
been issued because the stylesheet is invalid.  So, I've gone back and
updated the code so that now errors are issued.

For those interested, changing the error handling for an attribute is now
just a matter of changing an argument to the
org.apache.xalan.processor.XSLTAttributeDef constructor that is called in
the build(...) method of org.apache.xalan.processor.XSLTSchema.  Valid
values are XSLTAttributeDef.WARNING and XSLTAttributeDef.ERROR.

 My only concern is that people have stylesheets that were working with
errors in them, but now they won't work.   In these cases, I believe the
behaviour of the processor is now correct and that if they were to try with
another processor that they would get similar results.   Of course, if
there are any problems/concerns, post a note....

Oh, error/warning messages that you will see from this validation are
always of the form:

     Illegal value: <attribute value> used for
<QNAME/ENUM/NMTOKEN/NCNAME/boolean/number> attribute: <attribute name>


Thanks,
   Ilene.

------
  XSLT Development, IBM Toronto Lab
    Internet: ilene@ca.ibm.com