xslt 2.0 how replace $ by escaped dollar (for conversion to LaTeX) -


i new xslt. googled extensively couldn't figure out how following:

i transforming xml latex. of course, latex needs escape characters such $ , #. tried following in replace function not work. (they work without replace function.)

<xsl:template match="xyz:doc"> \subsubsection{<xsl:value-of select="replace( xyz:headline, '(\$)', '\$1' )"/>}   ... </xsl:template>  <xsl:template match="xyz:doc"> \subsubsection{<xsl:value-of select="replace( xyz:headline, '\$', '\$' )"/>}   ... </xsl:template> 

possible content escaped is: "locally defined field #931" or "locally defined subfield $b"

what doing wrong? many answers!

if want replace dollar symbol $ in input \$ in output use replace(xyz:headline, '\$', '\\\$').

if there several characters need same escaping replace(xyz:headline, '([$#])', '\\$1') should do.

sample @ http://xsltransform.net/bdxtqx/1


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -