Project

Profile

Help

xsltTransformer.setInitialContextNode(source) Error

Added by Sathya Selva over 4 years ago

Hi All, I use xsltTransformer.setInitialContextNode(source) for web services. It produces the output for first hit but the Second hit it throws the exception on this line(xsltTransformer.setInitialContextNode(source)).

Exception : externally supplied nodeinfo belongs to the wrong configuration.

Saxon Version Saxon 9 HE


Replies (4)

Please register to reply

RE: xsltTransformer.setInitialContextNode(source) Error - Added by Michael Kay over 4 years ago

Firstly, I would recommend using a new Transformer (XsltTransformer, Xslt30Transformer, JAXP Transformer) for each transformation. It's not expensive to create one, and it reduces the difficulties of tidying up if a transformation fails for any reason.

But the key error here is that the XsltTransformer belongs to one Saxon Configuration (or s9api Processor) and the supplied node belongs to another, presumably because it was created by a DocumentBuilder (or perhaps a query or transformation) running under a different s9api Processor. The reason this doesn't work is that they need to use the same NamePool to map integers to names for fast matching, I would generally recommend running everything under a single Configuration (or s9api Processor, or JAXP TransformerFactory).

RE: xsltTransformer.setInitialContextNode(source) Error - Added by Michael Kay over 4 years ago

I deleted the other copy of your post. It's not helpful to ask the same question in two different places.

RE: xsltTransformer.setInitialContextNode(source) Error - Added by Sathya Selva over 4 years ago

@Michael Kay thanku for your response, i will try this method.

RE: xsltTransformer.setInitialContextNode(source) Error - Added by Sathya Selva over 4 years ago

@Michael Kay it's working for me, Thank you so much.

    (1-4/4)

    Please register to reply