[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Search and Replace in XSLT
I'm not sure that you want a search and replace function (though the translate() function would do this). >From the input: <img src="x.bmp" alt="[tag]"/> you want the output: <img src="x.bmp"><tag/></img> This could be done in the following way: <xsl:template match="img"> <img src="{@src}"> <xsl:element name="{translate(@alt,'[]', '')}" /> </img> </xsl:template> (though it would eliminate the need for the translate function if the [ and the ] were not in the source) Hope this helps, Ben 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
|