XSLT Document('') Function does not Return the Stylesheet
(Doc ID 1337045.1)
Last updated on JANUARY 30, 2022
Applies to:
Oracle Database - Enterprise Edition - Version 11.1.0.7 and laterInformation in this document applies to any platform.
Symptoms
When an empty string is passed to the XSLT Document() function it should parse the current stylesheet and return a single node, the root node of the stylesheet itself as stated in the W3C Standard (http://www.w3.org/TR/xslt#document). So when running a transformer in the database using the following XSL with document(''):
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:copy-of select="document('')"/>
</xsl:template>
</xsl:stylesheet>
The stylesheet should be returned. Instead we see either <doc/> or <doc><doc/>
Note the W3C Standard states:
Function: node-set document(object, node-set?)
...
Note that a zero-length URI reference is a reference to the
document relative to which the URI reference is being resolved;
thus document("") refers to the root node of the stylesheet; the tree
representation of the stylesheet is exactly the same as if the XML
document containing the stylesheet was the initial source document.
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Cause |
Solution |
References |