[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: is there a more elegant way to change page refere
On 28/05/2012 16:42, Terry Ofner wrote:
<ref><b>TG:</b>pp. 19, 20, 21, 29, 32, 40, 43, 44, 46, 56, 57, 58, 60, 61, 66, 67–68</ref> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="ref[b='TG: ']"> <ref> <xsl:copy-of select="b"/> <xsl:analyze-string select="b/following-sibling::text()" regex="[0-9]+"> <xsl:matching-substring> <xsl:value-of select="number(.)+2"/> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="."/> </xsl:non-matching-substring> </xsl:analyze-string> </ref> </xsl:template> </xsl:stylesheet> produces: $ saxon9 ref.xml ref.xsl <?xml version="1.0" encoding="UTF-8"?><ref><b>TG: </b>pp. 21, 22, 23, 31, 34, 42, 45, 46, 48, 58, 59, 60, 62, 63, 68, 6970</ref> David
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
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
|