[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: replacing a string value
I'm going to assume Rick means a hyperlink to a graphic, such as an <IMG
SRC="..."/> element....
In the simple case, it could be as easy as <xsl:template match="foo"> <xsl:copy> <!-- copying the foo since Rick didn't tell us otherwise --> <xsl:if test=".='?'"> <!-- testing if the value of the current node is equal to the string '?' --> <img src="questionmark.jpg"/> </xsl:if> </xsl:copy> </xsl:template> But this is assuming many things. Things are trickier if you need to worry about strings floating in other strings (not just testing for and replacing entire strings) -- then you will have to recurse over your text node, as Jeni does when replacing a string with another (Rick, see www.jenitennison.com). Also whitespace might be a problem: you may have to work around that. Then too, there are tricks one can use (not shown here) to make the solution more scalable. But mainly, Rick hasn't said if, when and what *else* happens to <foo> elements or the text inside them, which he might have to account for. I hope that helps, Wendell At 05:30 PM 11/29/01, you wrote: [rick schochler] ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== 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
|