I expected the output and input xml to be identical but the output xml has additional attributes with the default value specified in DTD. I am aware that xml processor generates these defalut nodes before XSLT processor and therefore XSLT cannot avoid this. I tried removing the DTD reference from the xml before inputting to XSLT, but it gives me error for undeclared entities. Since I am not the owner of the DTD I cannot change the attributes to OPTIONAL. Is there a way to avoid inclusion of default attributes being added to the output xml?
Subject:XSLT outputs default attributes and values Author:Manikandan Surendranath Date:07 Apr 2005 04:37 AM
I will try that, but one more issue using DTD reference is that XSLT replaces named entities with equivalent encoded character. I have an entities   in input but in the output it was replaced by an emspace character. Can this be avoided?
Subject:XSLT outputs default attributes and values Author:Tony Lavinio Date:07 Apr 2005 09:25 AM
XSLT doesn't know anything about entities, or even default values
for attributes.
The XML parser itself is what parses the XML file, and converts
entities and supplies the default values. This is just the way
XML engines work - the parser builds the data model, applying whatever
it needs to from the DTD. Then the next step, whether it is XSLT
or XQuery or whatever, works on the model. Then, when the engine is
finished, the XML serializer (the inverse of the parser) takes the
result and turns it back into text. XSLT 2.0 does include a mechanism
for instructing the serializer to convert certain Unicode code-points
back into entities; see http://www.w3.org/TR/xslt20/#character-maps
You can use this with Saxon 8, which we support as one of our XQuery
engines.