RE: xml to xml identity transforms, and reading the DTD

Subject: RE: xml to xml identity transforms, and reading the DTD
From: "DuCharme, Robert" <Robert.DuCharme@xxxxxxxxxx>
Date: Thu, 8 Jun 2000 14:10:26 -0400
>So the question is, do any of the XML parsers which I might plug in to
>(say) Saxon support this minimal level of DTD reading, in which
>default values are NOT applied?

It's not a matter of applying attribute values, but of supplying them. An
XML parser is required to pass along an element's attribute values, and has
various places to look for them (the start tag, the element type's attribute
list declaration), but isn't required to report where it found them, so the
app using the parser has no way of knowing whether an attribute value is
being supplied because it was specified as the default value. 

The issue reminds me of the answer to the classic XSL-L question "How can I
pass along entity references to my output instead of having the entity
values substituted for the references": you're looking for a way to prevent
the parser from doing something that it's required to do by the XML spec, so
(unless some parser author has exposed this kind of behavior as an option)
tinkering directly with parser source code is probably the only way to go
about it. 

Or, of course, a post-processing step that copies the document without
copying certain attributes if they have a certain value, but I assume you're
looking for a more general solution.

Bob DuCharme           <bob@>  "The elements be kind to thee, and make thy
spirits all of comfort!" Anthony and Cleopatra, III ii

 XSL-List info and archive:

Current Thread