Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is there is behavior change using XMLTRANSFORM in 19C

Scottfry S.Nov 17 2021

We have been chasing down a compilation error on our newly upgraded 19C server we think we have it narrowed down the XMLTRANSFORM function. Please take the follow code snippet on 12C.
SQL> with
params_ as
(
select q'[<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:m="http://markets.midwestiso.org/dart/xml">
<xsl:template match="/">
<xsl:for-each select="//m:SubmitActivity">
<xsl:for-each select="m:Function">
<xsl:for-each select="m:Invocation">
<xsl:for-each select="m:Parameter">
<xsl:variable name="tradedate" select="@value"/>
</xsl:for-each>
<xsl:value-of select="concat($tradedate)"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>]' v_xsltdoc,
q'[<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<QueryResponse xmlns="http://markets.midwestiso.org/dart/xml">
<SubmitActivity>
<Function name="VirtualBid">
<Invocation>
<Parameter name="Day" value="testDATE"/>
</Invocation>
</Function>
</SubmitActivity>
</QueryResponse>
</Body>
</Envelope>
]' v_xmlclob
from dual
)
select xmltransform(xmltype(v_xmlclob), xmltype(v_xsltdoc))
from params_;

XMLTRANSFORM(XMLTYPE(V_XMLCLOB),XMLTYPE(V_XSLTDOC))
------------------------------------------------------------------------------------------------------------------------------------------------------
testDATE

SQL>
And then we do the same exact query on 19C.
SQL> with
params_ as
(
select q'[<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:m="http://markets.midwestiso.org/dart/xml">
<xsl:template match="/">
<xsl:for-each select="//m:SubmitActivity">
<xsl:for-each select="m:Function">
<xsl:for-each select="m:Invocation">
<xsl:for-each select="m:Parameter">
<xsl:variable name="tradedate" select="@value"/>
</xsl:for-each>
<xsl:value-of select="concat($tradedate)"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>]' v_xsltdoc,
q'[<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<QueryResponse xmlns="http://markets.midwestiso.org/dart/xml">
<SubmitActivity>
<Function name="VirtualBid">
<Invocation>
<Parameter name="Day" value="testDATE"/>
</Invocation>
</Function>
</SubmitActivity>
</QueryResponse>
</Body>
</Envelope>
]' v_xmlclob
from dual
)
select xmltransform(xmltype(v_xmlclob), xmltype(v_xsltdoc))
from params_; 39 40
ERROR:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00607: Invalid reference: 'tradedate'.

no rows selected

SQL>

Seems pretty basic but we are stumped. We also sadly use calls like this in a variety of places so we need to address this before moving to 19C. Any help would be appreciated... I'm guessing this may be a syntax change where some feature we are using h

Comments
Post Details
Added on Nov 17 2021
1 comment
306 views