#787 Omissions in s9api

v9.0
closed
nobody
s9api API (27)
5
2012-10-08
2008-03-09
Michael Kay
No

Unfortunately the s9api interface provides no direct way to construct an XdmValue given a collection of XdmItem objects (for example, a collection of nodes). This makes it extremely difficult to pass a sequence of nodes as a a parameter to a stylesheet, except in the special case where the sequence of nodes is the result of evaluating an XPath expression.

A patch is being provided to remedy this. It introduces a new constructor as follows:

/**
 * Create an XdmValue as a sequence of XdmItem objects
 * @param items a sequence of XdmItem objects. Note that if this is supplied as a list or similar
 * collection, subsequent changes to the list/collection will have no effect on the XdmValue.
 * @since 9.0.0.4
 */

public XdmValue(Iterable<XdmItem> items);

At the same time another omission will be recified: the XsltExecutable provides no "trapdoor" method to obtain access to the underlying Controller. The same patch adds a method getUnderlyingController().

Discussion

  • Michael Kay
    Michael Kay
    2008-03-17

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 9.0.0.4

     
  • Michael Kay
    Michael Kay
    2008-03-30

    Logged In: YES
    user_id=251681
    Originator: YES

    Actually getUnderlyingController() is a method on the s9api XsltTransformer class, not the XsltExecutable as stated.