User:Mjb/Oracle XSLT processor bugs

From Offset
< User:Mjb
Revision as of 14:27, 11 August 2006 by Mjb (talk | contribs) (xsl:message output can corrupt XML or HTML result tree serialization)
Jump to navigationJump to search

I've had to use the Oracle XSLT processor twice: once in 2001, and once in 2005.

Both times, I ran into the same set of bugs which render this processor incompatible with other processors and basically not XSLT 1.0 conformant. At first it was amazing to me that these problems have not been fixed in all this time, but then I discovered that Oracle has the worst bug reporting and tech support system ever. It is basically impossible to file a simple bug report. So it's no wonder things never get fixed.

Here are the bugs:

Empty-string parameter sometimes tests true

Example needed

Empty-string parameter sometimes causes crash

Example needed

xml-stylesheet PIs are omitted from source tree

Example needed

xsl:message output can corrupt XML or HTML result tree serialization

The following stylesheet, applied against any source doc, should result in the output of a prolog and an empty <result/> element, along with a 'hello' message from the processor:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="/">
    <result>
      <xsl:message terminate="no">hello</xsl:message>
    </result>
    <xsl:text>
</xsl:text>
  </xsl:template>

</xsl:stylesheet>

In these command-line examples, 'oraxsl' is an alias for 'java -classpath /home/mike/xml/oracle/lib/xmlparserv2.jar:/home/mike/xml/oracle/lib/xmlmesg.jar oracle.xml.parser.v2.oraxsl':

The main problem is that an extraneous element start tag is serialized:

$ oraxsl dummy.xml oraxsl-bug.xsl out
file:/portnoy/home/mike/xml/test/oraxsl-bug.xsl: 
Message: hello
$ cat out
<?xml version = '1.0'?>
<result>
   <result/>

A secondary problem is that if an explicit output target is not given, then both the serialized result tree and the processor message are sent to stdout, whereas it would make more sense for the processor message to go to stderr, where it will not interfere with the stdout stream.

$ oraxsl dummy.xml oraxsl-bug.xsl > out
$ cat out
<?xml version = '1.0'?>
file:/portnoy/home/mike/xml/test/oraxsl-bug.xsl: 
Message: hello
<result>
   <result/>

The expected results were more like this:

$ saxon -o out dummy.xml oraxsl-bug.xsl
hello
$ cat out
<?xml version="1.0" encoding="utf-8"?>
<result/>

Last-modified date/time of importing stylesheet affects loading of imported stylesheets

Imported stylesheets are not reloaded when they're changed, unless the importing stylesheet is also touched.

Example needed

xsl:when without a 'test' attribute is allowed

Example needed

xsl:param in imported stylesheets not handled correctly

Example needed

Oracle XML DOM bugs

Document is an instance of Element

I'm not entirely sure this is forbidden by W3C DOM, but it is counterintuitive. Saxon cannot be used to process an Oracle XML DOM Document because of it; Saxon is in the wrong for not using proper DOM node type attributes instead of "instanceof", but I think Oracle shouldn't be calling a Document an Element, either.