[JIRA] Created: (MDA-45) XSLValidationStage should start from document node, not document element

Ian Young (JIRA) noreply at shibboleth.net
Fri Aug 5 10:25:25 BST 2011


XSLValidationStage should start from document node, not document element
------------------------------------------------------------------------

                 Key: MDA-45
                 URL: https://issues.shibboleth.net/jira/browse/MDA-45
             Project: Metadata Aggregator
          Issue Type: Bug
          Components: DOM Metadata
    Affects Versions: 0.6
            Reporter: Ian Young
            Assignee: Ian Young


The XSLTransformationStage starts its transform from the containing document:

{code}
final Element element = domItem.unwrap();
...
transformer.transform(new DOMSource(element.getOwnerDocument()), new DOMResult(newDocument));
{code}

This allows XPath expressions used to work exactly the same way as they do in, for example, stand-alone Xalan.  In particular, things like "/" can be used to refer to absolute paths.

The XSLValidationStage, however, starts its transform from the wrapped element:

{code}
transformer.transform(new DOMSource(domItem.unwrap()), new DOMResult());
{code}

This means that things like "/" can *not* be used to refer to absolute paths.  This isn't normally an issue for validation transforms, but I came across a case recently where it did.

We should change XSLValidationStage to have the same familiar semantics for XPath expressions as found in stand-alone Xalan and in XSLTransformationStage:

{code}
transformer.transform(new DOMSource(domItem.unwrap().getOwnerDocument()), new DOMResult());
{code}

This will be a breaking change for any validation transform that uses absolute paths.  But it's worth it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the commits mailing list