paul.band...@nomura.com wrote:
I need to be able to augment an XSLT generated document by adding the contents of another document to it as a child node. I tried generating to an XalanSourceTreeDocument but when I invoked addChild an XalanDOMException was raised with code 7 (modification not allowed). Do I need to generate to an Xerces DOM instead, using FormatterToXercesDOM as per one of the examples, and if so what are the steps to add one document as the child of another XercesDOM – i.e. can I indeed add to a fully formed document and do I need to clone the nodes from one document before adding to another?
If you want a mutable result, then yes, you have to use the Xerces-C DOM.

However, you might want to look at the XSLT document function, instead of generating a result DOM and modifying it. You can use the xsl:copy-of instruction to copy an entire document anywhere you like in the result tree. It will also be much more efficient than generating a Xerces-C DOM document as the result, then appending another document.

Dave

Reply via email to