# Java API changes

The `NodeInfo` interface has changed:

- The `generateId()` method, rather than returning a String, now appends the generated ID value to a `FastStringBuffer` supplied by the caller. This is for performance reasons: `generateId()` is often recursive and was causing many String concatenation operations.

- the `equals()` and `hashCode()` methods on `NodeInfo` are now defined to support tests on node identity. Thus `equals()` delivers the same result as `isSameNodeInfo()`. Note: third party implementations of `NodeInfo` should be changed to support this definition. Users of the `NodeInfo` interface should be aware that third-party implementations of the interface may not have been updated to support this change.

A number of methods on the `Controller` interface have changed to reflect the fact that there is a difference between XSLT and XQuery in the handling of the initial context item/node, and the context item used for evaluating global variables. These can now be set independently using the methods `setInitialContextItem` and `setGlobalVariableContext`. (The difference is that in XSLT, global variables are evaluated with the context node set to the root of the tree containing the initial context item, whereas in XQuery, the initial context item is used directly.) Note that although the standard XSLT and XQuery interfaces follow the rules of their respective languages, it is possible by low-level API calls to achieve effects not permitted by the language specs, such as defining an initial context item in XSLT that is not a node.

The `systemId` passed in the constructor to a `StreamResult` may now be a relative URI, which is interpreted relative to the current directory.

In the `NodeOverNodeInfo` interface which provides a DOM wrapper to the Saxon tree structure, the `isEqualNode()` method has been enhanced to bring it closer to the DOM specification, by invoking the `saxon:deep-equal()` function with appropriate parameters.

I have re-instated the ability to determine the effective boolean value of an external object, that is, an value returned by an extension function that wraps a Java object. The effective boolean value is true if and only if the Java object reference is non-null.

Next