
The difference with XSLT is that I can implement it so that I get the result document I want: I can set the DOCTYPE details and filter out attributes I don't want in the instance. It's more implementation work but doable. With XQuery update, if I had to update every element simply to remove unwanted defaulted attributes then it would be no more convenient than the equivalent XSLT (and harder to write, at least for me). And I don't think XQuery has the equivalent of the <xsl:output> or <xsl:result-document> instructions. Cheers, E. ————— Eliot Kimber, Owner Contrext, LLC http://contrext.com On 9/17/14, 9:20 AM, "George Bina" <george@oxygenxml.com> wrote:
Hi Eliot,
AFAIK XSLT will have the same problem, it will not preserve the DOCTYPE declaration and it has no way to tell that an attribute was actually specified in the document or its value comes from the DTD/schema. There are some ways to workaround these but none is elegant.
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 17/09/14 17:10, Eliot Kimber wrote:
I suspect this is a limitation or unavoidable consequence of how XQuery update works, or at least how Saxon does things, but I wanted to check.
If I have a DTD-based document, e.g., a DITA map or topic, and apply an XQuery update to it using Saxon EE, I noticed that the entire document is updated such that the DOCTYPE declaration is removed and all defaulted attributes are now explicit in the instance, which is obviously not to be desired.
Is there any way to avoid this behavior?
My alternative is to use XSLT of course but I was trying to use XQuery update as being more convenient for certain types of enhancements to existing documents, namely adding attributes to existing elements.
Thanks,
Eliot ————— Eliot Kimber, Owner Contrext, LLC http://contrext.com
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user