This discussion is archived
1 Reply Latest reply: Nov 6, 2013 8:10 AM by odie_63 RSS

How to use encode-for-uri

c8a4e64e-ab20-441a-8ecd-a28134204b9b Newbie
Currently Being Moderated

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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points