XSLT Extensions

From Plex-XML
Jump to: navigation, search

XSLT extensions you could use "out of the box" in Plex-XML if you use the default Xalan-Java 2.7.1 XSLT processor .

First of all you need to extend your stylesheet element:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 xmlns:set="http://exslt.org/sets"
 xmlns:plex="http://xml.apache.org/xalan/de.bodow.plex.PleXML" 
 xmlns:str="http://xml.apache.org/xalan/java/java.lang.String" 
 exclude-result-prefixes="set plex str"
>  

Contents

java.lang.String

replaceAll

<xsl:value-of select='str:replaceAll(str:new(string(@value)), "\n","<br/>")'/>

plex-xml

encodeURIComponent

<xsl:value-of select='plex:encodeURIComponent(str:new(string(@value)))'/>
 
entities =     array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
replacements = array('!'  , '*'  , "'"  , "("  , ")"  , ";"  , ":"  , "@"  , "&"  , "="  , "+"  , "$"  , "    ,"     , "/"  , "?"  , "%"  , "#"  , "[", "]");

exslt

exslt:node-set

<xsl:for-each select="exslt:node-set($v_FooPath)/example">
 ...do something...
</xsl:for-each>