You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by "Martinez, Christian" <Ch...@bofasecurities.com> on 2005/04/20 16:11:15 UTC

Modifying an in-memory DOM tree

Hello, this might seem like a silly question to some, but here it goes.  I have a DOM instance of my XSLT in memory.  Based on request, I insert an <xsl:sort/> element at a user specified location.  How do I regenerate the DOM tree for it to show the sort element?


Christian

Re: Modifying an in-memory DOM tree

Posted by Joseph Kesselman <ke...@us.ibm.com>.
XSLT is defined as creating a new document; it really isn't architected to
be used for updating an existing tree. I believe XQuery has proposed
introducing an update facility; I don't know whether that might also make
its way into XSLT 2.0.

If you really want to patch an existing model in place... well, you could
try writing extensions for the purpose, but there are a number of reasons
why that's hazardous; our stylesheet logic assumes the source document is
stable and correct operation is emphatically not guaranteed if you patch it
in mid-transformation. It might be better to use our XPath API to find the
change point and hand-code the actual alteration.

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk