Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use encode-for-uri

Mark HartNov 6 2013 — edited Nov 6 2013

I have a BI Publisher template in R12 eBusiness suite. The purpose is to produce some xml output. However, a i produce the output I need to replace special chagractes such as & , spaces etc with the encoded equivalents.

I have attempted to use encode-fo-uri, as the XSLT Processor for Java should allow this. http://docs.oracle.com/cd/B19306_01/appdev.102/b14252/adx_j_xslt.htm#sthref221. In this document it says : Oracle XDK XSLT processor implements both the XSLT and XPath 1.0 standards as well as the current working drafts of the XSLT and XPath 2.0 standards. The XDK XSLT processor supports the XPath 2.0 functions and operators. Hence I would expect it to find encode-for-uri

Howver when I run this I receieve error:

oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'encode-for-uri

The code is:

<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions"
xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date" >

<xsl:output omit-xml-declaration="yes"/>
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">

<xsl:element name="myfield">
             <xsl:attribute name="DataType">String</xsl:attribute>                
             <xsl:value-of select='xdoxslt:encode-for-uri("ABC")' />
</xsl:element>
    
</xsl:template>

Help would be much appreciated.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2013
Added on Nov 6 2013
1 comment
1,734 views