>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
While that sounds like an eminently good suggestion, I need to make this change without altering the XSLT workings of this program. > If you want a mutable result, then yes, you have to use the Xerces-C DOM. Ok, thanks so what I'm trying to is possible. You probably haven't wanted to tell me what is probably plainly obvious to anyone more familiar with these API's, but how do I alter an existing DOM document - I've seen and used the content handler to create a new document, but once its 'endDocument' method has been called - can the constructed document be further modified? -----Original Message----- From: David Bertoni [mailto:dbert...@apache.org] Sent: 13 August 2009 19:07 To: xalan-c-users@xml.apache.org Subject: Re: Relative newbie question - How to augment XSLT generated output? 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 This e-mail (including any attachments) is confidential, may contain proprietary or privileged information and is intended for the named recipient(s) only. Unintended recipients are prohibited from taking action on the basis of information in this e-mail and must delete all copies. Nomura will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in, this e-mail. If verification is sought please request a hard copy. Any reference to the terms of executed transactions should be treated as preliminary only and subject to formal written confirmation by Nomura. Nomura reserves the right to monitor e-mail communications through its networks (in accordance with applicable laws). No confidentiality or privilege is waived or lost by Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is a reference to any entity in the Nomura Holdings, Inc. group. Please read our Electronic Communications Legal Notice which forms part of this e-mail: http://www.Nomura.com/email_disclaimer.htm