Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
xsl que convierte lo nombres de los elementos a mayusculas
declare
xml xmltype:= xmltype('
<root>
<a k="2">
<b j="2">aaa</b>
</a>
</root>
');
xsl xmltype:= xmltype(
'
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="smallcase" select="''abcdefghijklmnopqrstuvwxyz''" />
<xsl:variable name="uppercase" select="''ABCDEFGHIJKLMNOPQRSTUVWXYZ''" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{translate(name(.),$smallcase,$uppercase)}">
<xsl:apply-templates select="@*|node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
'
);
result xmltype;
begin
SELECT XMLtransform(xml, xsl.getstringval()) into result FROM dual;
dbms_output.put_line(result.getstringval());
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.