Subject: Re: [xsl] Transforming portions of content or values From: Rick Taylor <taylor@xxxxxxxx> Date: Wed, 07 May 2003 09:58:51 -0600 |
Then in your template You need to process the string 'Worked for XYZ Inc.' such that you 1. get the substring before 'XYZ' 2. process the XYZ 3. get the substring after 'XYZ'
<xsl:template match="experience"> <xsl:value-of select="substring-before(.,$companyName)"/> <a href="{$companyURL}"> <xsl:value-of select="$companyName"/> </a> <xsl:value-of select="substring-after(.,$companyName)"/> </xsl:template>
2. You can simply put one in. <experience dates="1990 - 2000" company="Worked for XYZ Inc.">
<xsl:template match="experience"> <xsl:value-of select="@dates"/> <xsl:text> </xsl:text> <xsl:value-of select="@company"/> </xsl:template>
Hi
1. How do I transform a portion of text in an XML document so that I can nest it within hyperlink tags in an XSL stylesheet for HTML display, as follows?
a. Content:
<experience>Worked for XYZ Inc.</experience>
transformed to HTML (where [XYZ] = hyperlink to www. xyz.com):
Worked for [XYZ] Inc.
b. Values:
<experience dates="1990 - 2000" company="Worked for XYZ Inc."/>
transformed to HTML (where [XYZ] = hyperlink to www. xyz.com):
1990 - 2000 Worked for [XYZ] Inc.
2. Which throws up another question: is it possible to insert a non-breaking space between text during the transformation e.g. between the 2000 and the 'Worked' as above?
Thanks
Charles
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Rick Taylor XML Developer PPDM Association
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Transforming portions of , Simon Kelly | Thread | Re: [xsl] Transforming portions of , C Baines |
Re: [xsl] Importing data from Excel, Rick Taylor | Date | [xsl] [XSL] Re:XPathAPI: How to ass, Joseph Kesselman |
Month |