Just wanted to share a finding with the Oracle XDB community and possibly suggest an enhancement to the xdb product development team (care of MDRAKE).
I had a scenario where I wanted to throw an exception from the XSLT.
A little Googling revealed this helpful post:
http://weblogs.asp.net/george_v_reilly/archive/2006/03/01/439402.aspx
...so I gave it a shot.
In my XSLT, I have a <xsl:choose> block with the following <xsl:otherwise> block:
<xsl:otherwise>
<xsl:message terminate="yes">Unknown Document Type</xsl:message>
</xsl:otherwise>
I used a stub test to run this through, giving it a file which would exercise the exception:
select xmltype(bfilename('XML_RESOURCES', 'data.xml'),0).transform(xmltype(bfilename('XML_RESOURCES', 'sanitize_xml.dev.xsl'),0))
from dual;
..and to my 'joy', I did get an exception:
ORA-30998: transformation error: execution of compiled XSLT on XML DOM failed
Hmm...would of been nicer to get something like what Eclipse/Xalan pops out:
file:/H:/eclipse_indigo_workspace/XSLT/sanitize_xml.xsl; Line #28; Column #59; Unknown Document Type
(Location of error unknown)Stylesheet directed termination
...i.e. my custom error message "Unknown Document Type" isn't output by Oracle.
Just to be safe, I tried a file which would NOT exercise this xsl:otherwise block and it did run through OK.
So, could XDB report a better error?
Thoughts?