xslt 2.0 - Can I apply a character map to a given node? -


if @ xslt specs seems character map applies whole document, bit possible use on given node, or within template ?

example : have node containing values, might contain characters don't play regular expressions when using in template. use replace functionwhich works well,, after few characters becomes pretty hard read or maintain. if have :

<xsl:variable name="mylookup" select=" replace( replace( replace( replace( string-join(/*/lookup/*, '|'), '\[','\\['), '\]','\\]'), '\(','\\('), '\)','\\)') "/> 

is there way achieve below fictitious example ?

<xsl:character-map name="escapechar">     <xsl:output-character character="[" string="\[" />     <xsl:output-character character="]" string="\]" />     <xsl:output-character character="(" string="\(" />     <xsl:output-character character=")" string="\)" /> </xsl:character-map>  <xsl:variable name="mylookup" select="string-join(/*/lookup/*, '|')" use-character-map="escapechar"/> 

i know not working @ all, make request bit visual.

any idea ?

i think character maps in xslt 2.0 serialization feature applied when result tree serialized file or stream don't see how apply 1 string or node during transformation.

as escaping meta characters of regular expression patterns, maybe http://www.xsltfunctions.com/xsl/functx_escape-for-regex.html helps.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -