[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to put in a variable the text from all element

Subject: Re: How to put in a variable the text from all elements of an specified type.
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Oct 2004 23:56:47 +0300
xsl variable text
At 2004-09-21 17:16 -0300, IceT wrote:
I want to put in a variable "x" all the content of the "name" elements. The following code didn't do the trick

<xsl:variable name="x" select="//name" />

It just selected the first ocurrence of name. What I want to do is, whenever a registered name is typed in the middle of a sentence, it will be marked as bold (at first, later I will add hyperlinks). So, every word typed will be matched against that list.

Even if it did get all names, they would also be concatenated and you wouldn't determine word boundaries.


How about:

  <xsl:variable name="x-rtf">
    <xsl:for-each select="//name">
      <xsl:value-of select="."/>
      <!--ensure a space between the end of the previous word to the
          start of the next word-->
      <xsl:text> </xsl:text>
    </xsl:for-each>
  </xsl:variable>
  <xsl:variable name="x" select="string($x-rtf)"/>

I hope this helps.

........................ Ken

--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.