I am generating and validating XML and am experiencing a problem where Oracle expands the full namespace from the prefix. The source document may look like this:
<pcy>
<tList>
<currTrn>
<TXN_A>1</TXN_A>
<TXN_B>2</TXN_B>
...
the transform looks like this:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sc="http://www.myCompany.com/schemaAlpha" xmlns:pl="http://www.myCompany.com/schemaBeta">
<xsl:template match="/">
<pcyItem>
<pl:mainTList>
<pl:currentTrnItem>
<sc:primaryTrnID>
<xsl:value-of select="/pcy/tList/currTrn/TXN_A"/>
</sc:primaryTrnID>
<sc:secondaryTrnID>
<xsl:value-of select="/pcy/tList/currTrn/TXN_B"/>
</sc:secondaryTrnID>
...
The correct output that I expect (and which I get when I use programs like JEdit - which has an XML transform plugin) looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<pcyItem xmlns:pl="http://www.myCompany.com/schemaAlpha" xmlns:sc="http://www.myCompany.com/schemaBeta">
<pl:mainTList>
<pl:currentTrnItem>
<sc:primaryTrnID>1</scom:primaryTrnID>
<sc:secondaryTrnID>2</scom:secondaryTrnID>
...
What Oracle actually produces looks something like this:
<pcyItem>
<pl:mainTList xmlns:pl="http://www.myCompany.com/schemaAlpha">
<pl:currentTrnItem>
<sc:primaryTrnID xmlns:sc="http://www.myCompany.com/schemaBeta">1</sc:primaryTrnID>
<sc:secondaryTrnID xmlns:sc="http://www.myCompany.com/schemaBeta">2</sc:secondaryTrnID>
...
It looks to me like Oracle is "inlining" or expanding all of the namespace prefixes. Why is it doing this and how can I get it to stop?