Oracle Transactional Business Intelligence

XSLT Template - Functions
Summary
Would like to use "functions" in XSLT template for BI reports, but it's not working
Content
I'm trying to use functions available in XSL and using the below namespace to refer XSLT Functions. But the link seems not working. Any idea how to resolve this issue?
xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.xdo.template.rtf.XSLTFunctions"
I just tried call lpad function <xsl:value-of select="xdoxslt:lpad('test', 65, ' ')" />; but getting an error.
Comments
-
Moved to the correct forum.
-
Please refer to the documentation: https://docs.oracle.com/middleware/11119/bip/BIPRD/extend_func.htm#sl_equiv
lpad('aaa',10,'.')
<?xdofx:lpad('aaa',10,'.')?>
The lpad function pads the left side of a string with a specific set of characters. The syntax for the lpad function is: lpad(string1,padded_length,[pad_string])string1 is the string to pad characters to (the left-hand side).padded_length is the number of characters to return.pad_string is the string that is padded to the left-hand side of string1 .
-
Looks like we cannot use the namespace xmlns:xdoxslt=http://www.oracle.com/XSL/Transform/java/oracle.xdo.template.rtf.XSLTFunctions in our local templates. When I ran the modified template thru BI publisher, it worked.
My question goes towards "how to use the Oracle provided namespace in our local templates. otherwise, how do test our XSL templates locally?
-
When you say local templates do you mean running the BIP XSLT template at a Java command line? Or something else?
If you are running the template using Java you need to make sure you have several of the .jar files included with the BI Publisher Desktop Tool in you classpath.
orai18n-collation.jar orai18n-mapping.jar orai18n.jar xdocore.jar xdoparser.jar xdoparser11g.jar
I have found it best to copy/reference these files from C:\Program Files (x86)\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\jlib as they also exist under another folder of the Desktop Tool installation folder.
I haven't used the lpad function specifically but several others.
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.xdo.template.rtf.XSLTFunctions"
exclude-result-prefixes="xdoxslt"><procdate><xsl:value-of select="xdoxslt:ora_format_date(xdoxslt:sysdate_as_xsdformat(), string('YYYY-MM-DD'), string('DEC'))"/></procdate>