#783 S9API with wrapped non-document nodes

v9.0
closed
Michael Kay
s9api API (27)
5
2012-10-08
2008-02-28
Michael Kay
No

When the S9API interface DocumentBuilder.wrap() is called, supplying as argument a node that is not a document node (for example an element), it's not clear what is supposed to happen. The JavaDoc says that the argument must be a document node. In fact, if it isn't a document node, the wrap() method returns a wrapper around the document node of the tree containing the supplied node. This is not exactly intuitive, and if the resulting node is supplied as the context item for evaluating a path expression, evaluation is likely to fail.

The method will be changed so that it returns a wrapper around the actual supplied node. A patch to this effect is being placed in Subversion.

Discussion

  • Michael Kay
    Michael Kay
    2008-03-17

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 9.0.0.4