[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?

Subject: Re: convert an attribute's value to a text node?
From: Gunther Schadow <gunther@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 02 Dec 2002 15:14:37 -0500
embryonic thread
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




-- Gunther Schadow, M.D., Ph.D. gschadow@xxxxxxxxxxxxxxx Medical Information Scientist Regenstrief Institute for Health Care Adjunct Assistant Professor Indiana University School of Medicine tel:1(317)630-7960 http://aurora.regenstrief.org



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.