Subject: Re: DOCTYPE causes appearance of unwanted attributes
From: Paul DuBois <paul@xxxxxxxxxxxx>
Date: Mon, 26 Jul 2004 21:31:01 -0500
|
> Paul DuBois wrote:
> > The DOCTYPE is correct, but I'm not interested in having the transform
> > add a bunch of unnecessary verbiage to an already large file. Having
> > explicit attributes included with the values that they would have anyway
> > adds no information.
>
> The parser is *required* to report the default attributes to the
> XSLT processor, which, ignorant of their origin in the DTD,
> faithfully drops them into the output.
I guess I don't follow.
How does _the parser_ have any idea of what the default attributes
are, given that they do not appear in the input document?
And how does it know what the attributes of _any_ element are, unless
it consults the DTD?
> Your options:
> - Use a modified DTD without the default attributes.
> - Add rules to your style sheet which filters unwanted
> attributes.
Or run xsltproc with the --novalid option, which as I indicated
solves the problem.
|