[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XSL special chars output prob.


Subject: Re: [xsl] XSL special chars output prob.
From: Mike Brown <mike@xxxxxxxx>
Date: Tue, 11 Jun 2002 12:05:34 -0600 (MDT)

CAO Tuan Dung wrote:
> And i have an additinal question. How to output character special as 
> '<', '>', '/'
> in the value of text. as valueof select = "...."

No need to escape '/' or '>', but you can use '&gt;' for '>' if it
makes things easier to edit.

  <xsl:value-of select="'1 &amp; 2 are both &lt; 3, but > 0'" />
  <xsl:copy-of select="path/to/some/nodes[. div $foo &lt; 2] />

A trick for including a string-delimiting quote:

  <xsl:variable name="q">'</xsl:variable>
  <xsl:value-of select="concat('don',$q,'t tread on me.')"/>

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread