[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Formatting text within an element
Dhruv, >I was interested in knowing whether it is possible >to format specific pieces of text within an element's content using XSL It is possible; it's all about the string functions in XSLT. See ch. 14 of the XML bible at http://metalab.unc.edu/xml/books/bible/updates/14.html or XSLT Programmer's Reference, ch. 7. For your example > ><para> > This publication covers the equipment found in the > Auxiliary, Blower and Engine Cab Areas (Fig. 1). For >repair > or overhaul of specific equipment listed in this >publication, > refer to the Backshop Manual. ></para> The following template will output '(Fig. X)' as an <a> element for Figure #'s 1-9: <xsl:template match="para[contains(.,'(Fig.')]"> <p> <xsl:value-of select="substring-before(.,'(Fig.')"/> <a> <xsl:attribute name="href">http://www.somewhere.org</xsl:attribute> <xsl:value-of select="substring(.,string-length(substring-before(.,'Fig.')),8)"/> </a> <xsl:value-of select="substring-after(.,')')"/> </p> </xsl:template> mark giacobbe mgiacobbe@xxxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|