1. I have an issue where my below code copies the attributes with default values from the dtd.
That's the way the language is defined. However, there's an option in Saxon to suppress this, provided you parse the document using a parser that allows Saxon to determine which attributes were in the original source and which were expanded from the DTD.
2. Also, the entities are transformed as original characters. I need the entities to be copied as such. Is there any way to do this?
No: the XSLT processor only sees the result of XML parsing, which contains the expanded entity references. The usual workaround is to use a non-XML-aware preprocess (e.g. sed/awk) to convert the entity references into normal text, e.g. © to %%copy; and then reverse the process on the final output.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|