|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: convert an attribute's value to a text node?
Thanks to faithful David Carlisle for pointing out the answer before I finally found it myself (by fgrepping saxon's source code :-). The answer was: construct a node set as a new result set. <xsl:variable name="stringAsText"> <xsl:value-of select="$string"/> </xsl:variable> As to David's and Joerg's question: what (the heck ;-) do I need to convert strings to text nodes? Here is the answer: because I am -- you guessed right -- throwing the text out for apply- templates. To see more detail of my use case, refer to the renewed regex (up-translation) thread (embryonic thread I should say, for now there's only my message.) Why am I not using call-templates etc? Because I never use call-templates as a matter of policy, except for really clear reasons, this not being one of them. I want to keep my XSLT code as closely aligned to the "event pattern matching" approach as possible. Whenever you may be using call-templates I use apply-templates in a specific mode. Your "procedure" metaphor is my use of a specific mode rather than a named template. This keeps my code relatively flexible for change. I am surprized how well I can still maintain this very dense functional programming code of mine in XSLT. I rarely feel that I am in the middle of a heap of ugly hacks and quick-fixes (unless when I look at code that I wrote before I made my policy decision against call-templates, and for-each, and choose/when for that matter.) regards -Gunther
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
|

Cart








