This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Q: Where to use XSLT functions like substring-before()?


> How would I use substring-before() (for example) to generate some text,
> something like this?
> 
> <xsl:element name="h1" value="substring-before('Mickey Mouse','e')"/>
> 
> yeilding:

'i before e, except after c' (except in weird and caffeine) :)

> <h1>Mick</h1>

What you want to construct is an element node 'h1' with a child text node
'Mick'.

<xsl:element name="h1">
  <xsl:value-of select="substring-before('Mickey Mouse','e')"/>
</xsl:element>

<h1>
  <xsl:value-of select="substring-before('Mickey Mouse','e')"/>
</h1>

   - Mike
___________________________________________________________
Mike J. Brown, software engineer, Webb Interactive Services
XML/XSL stuff: http://www.skew.org/    http://www.webb.net/


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]