FWIW, this is why the DOM included the "specified" flag on Attr nodes. I
think DOM Level 3 may address how/whether one asks the same question about
schemas.

Of course the real question is whether the default is present in the
_output_ DTD/schema, which is not necessarily the same as the input and may
not have the same defaults. So to do this properly you essentially need to
revalidate your generated document and use that information to strip out
redundant explicit attrs. A schema-aware serializer could do that. I'm not
sure whether DOM Level 3 can provide that functionality or not.

But even then, you may run into situations where the users would object to
your stripping something they inserted manually (comments shouldn't be
meaningful either but people get upset if you don't offer the option to
preserve them)... so you wind up needing to examine both sides of the
equation, and have a serializer which strips out only attributes which are
both default *and* not-explicitly-specified.

Doable, probably. May be beyond scope for our standard solution, since
revalidating could be expensive. Would be a good tool to have available,
though.

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to