[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xalan-j-users
Subject:    Re: Getting values from DOM Document and DTM
From:       "Joseph Kesselman/CAM/Lotus" <joseph_kesselman () us ! ibm ! com>
Date:       2002-04-26 17:07:49
[Download RAW message or body]


>I understood the DTM to be immutable, a snapshot of the DOM at the
>time the DTM was created, are you saying this is not always the case?

The DTM itself is immutable.

But if you look at how DOM2DTM is implemented, you'll see that we do not
snapshot all the data from the DOM -- we don't copy text strings, for
example -- for efficiency reasons. Thus, if you change the DOM, the DOM2DTM
built from it may be damaged.

Also, DOM2DTM builds the DTM model incrementally -- again, for performance
reasons -- which also makes us vulnerable to changes in the DOM.

This means YOU SHOULD NOT CHANGE THE DOM WHILE XALAN IS IN OPERATION. DOING
SO MAY YIELD INCORRECT RESULTS, AND MAY CAUSE A COMPLETE CRASH OF THE XSLT
PROCESSOR.

We do not make any promises about which changes might or might not be safe.
If you attempt to change the DOM while Xalan is running you're on your own,
and the results next week may not match the results this week.


>In Statement 2 (also from original email), I pass a DTM so no proxy is
>being created and the XPath is being executed against the passed DTM?
>Statement 2:
>obj = xpath.execute(_xpathcont, dtm.getDocument(), null);

You're passing a reference to a DTM node. But if the DTM in question was a
DOM2DTM, you're subject to the same hazards if you attempt to modify the
original DTM.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic