Created
October 31, 2016 07:20
-
-
Save Dviejopomata/c61888e79328ae570c72ffa0ae0a2583 to your computer and use it in GitHub Desktop.
xsl que convierte lo nombres de los elementos a mayusculas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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