I think I would want to see the wider context as to what your application is trying to do.

The default Saxon tree model is the TinyTree, and this is immutable. A lot of performance benefits come from using an immutable tree, in particular, sorting nodes into document order (a common XPath operation) can be done much more efficiently. But if using mutable trees is important to your application, there are plenty of other tree models Saxon supports that allow mutability, for example JDOM2 or XOM. Or even DOM, though that is the slowest of them all.

You should not attempt to make in-situ changes to a tree if any queries are using the tree at the time; Saxon assumes that a tree will not change during the execution of a query.

Michael Kay
Saxonica


On 6 Aug 2013, at 17:04, Kunal Chauhan wrote:

Hi,

I am using Saxon9.3 HE.
I have an XQItem of a node. and I want to change it's value at runtime.

I tried below code.

XQItem eleXQ = ele.getXqItem();
SaxonXQItem item = (SaxonXQItem) eleXQ;
            if (item.getSaxonItem() instanceof NodeInfo) {

                ElementOverNodeInfo nodeLine=(ElementOverNodeInfo)item.getNode();
                nodeLine.getTextContent();
                sysout(nodeLine.getTextContent());
                nodeLine.setTextContent("555");
                sysout(nodeLine.getTextContent());

I am getting The Saxon DOM cannot be updated error.

can any one suggest any possible way ?


T
hanks,

--
Kunal Chauhan
[+918655517141]
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help