Project

Profile

Help

Bug #1675

closed

Transforming parentless element on .NET

Added by Michael Kay over 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Category:
.NET API
Sprint/Milestone:
-
Start date:
2013-01-08
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

From Max Toro on the Saxon help list:

I'm using Saxon-HE 9.4.0.6 for .NET

I'm having trouble with a transformation that uses a root element node

(doesn't have a parent document node) as initial context node. I get a

NullReferenceException on Saxon.Api.XsltTransformer.Run(XmlDestination

destination), looking with reflector I suspect the issue might be with

one of these lines:

DocumentInfo doc = this.initialContextNode.getDocumentRoot();

        this.controller.registerDocument(doc, (doc.getBaseURI() ==

null) ? null : new DocumentURI(doc.getBaseURI()));

I think it's trying to get the root node as a document node, which it

isn't. This element node is constructed in an XSLT transformation,

passed as argument to an integrated extension function which uses it

as initial context node in a new transformation, which is the one that

fails.

Besides the NullReferenceException, does XSLT allow you to start a

transformation with a parentless element?

Please register to edit this issue

Also available in: Atom PDF