, , , ,

Using java method in XSLT Oracle XDK

четверг, 18 ноября 2010 г. Оставить комментарий

Continue to consider new features xsl-transformer in Oracle XDK.
Now let's talk about the Java method.

First of all, the database user must be given the right to download the java classes.


begin
dbms_java.grant_permission( 'SCOTT', 'SYS:java.lang.RuntimePermission', 'getClassLoader', '' );
end;

Now you can try an example.



select ora_20000_xmlutility.XMLTransformClob
(xml_sample.xmltext,
q'~<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:jstring="http://www.oracle.com/XSL/Transform/java/java.lang.String">
<xsl:template match="/">
<xsl:variable name="str1" select="jstring:new('HeLlO wOrLd')"/>
<xsl:value-of select="jstring:toUpperCase($str1)"/>
</xsl:template>
</xsl:stylesheet>
~'
)
from xml_sample;

Result:



<?xml version = '1.0' encoding = 'UTF-8'?>
HELLO WORLD

Additional links:


0 коммент. »

Оставьте Ваш комментарий