Follow by Email

mercoledì 4 maggio 2011

SOA 11g - XSLT-Transformation Error remove empty element

Applying this xslt transformation on Oracle SOA Enviroment 11g to remove empty xml element from output message

<xsl:stylesheet version="1.0" xmlns:xsl="">
  <xsl:template match="@*|node()">
    <xsl:if test=". != '' or ./@* != ''">
        <xsl:apply-templates select="@*|node()"/>

the following error occurs at runtime on server
javax.xml.transform.TransformerException: XML-22900: (Fatal Error) An internal error condition occurred.
at oracle.xml.jaxp.JXTransformer.reportException(
at oracle.xml.jaxp.JXTransformer.transform(
Caused by: java.lang.RuntimeException: oracle.xml.parser.v2.XMLAttr@14929109 xdkGetPrevNode
at oracle.xml.parser.v2.XMLNode.xdkGetPrevNode(
This error doesn't occur using Jdeveloper xslt test tool.

The error in soa runtime seems determined from the evaluation of attributes.

I've solved this issue using

<xsl:apply-templates select="node()| @*"/>

instead of
<xsl:apply-templates select="@*|node()"/>

in xslt template.
I hope this could help.

Nessun commento:

Posta un commento