XSLT: concatenating selected text nodes

Discussion in 'XML' started by Andy Fish, Jan 10, 2005.

  1. Andy Fish

    Andy Fish Guest

    in XSLT, if I want to concatenate _all_ the child text nodes, I can just do

    <xsl:value-of select=".">

    however, if I want to select and concatente only _some_ of the text nodes.
    for instance

    <xsl:value-of select=".//foo/text()">

    this doesn't work as it just takes the first element in the node set. Is
    there any way of achieving this without using <xsl:for-each> to explicitly
    loop round them all?

    TIA

    Andy
     
    Andy Fish, Jan 10, 2005
    #1
    1. Advertisements

  2. use copy-of not value-of


    David
     
    David Carlisle, Jan 10, 2005
    #2
    1. Advertisements

  3. Andy Fish

    Andy Fish Guest

    "David Carlisle" <> wrote in message
    news:...
    >
    > use copy-of not value-of
    >


    worked a treat - thanks david.

    >
    > David
     
    Andy Fish, Jan 10, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asd
    Replies:
    3
    Views:
    639
    Arnaud Berger
    May 23, 2005
  2. gavnosis
    Replies:
    0
    Views:
    696
    gavnosis
    Aug 2, 2003
  3. Michael Reiche
    Replies:
    3
    Views:
    11,441
    Michael Reiche
    Feb 5, 2004
  4. Timo Nentwig

    selecting nodes between other nodes

    Timo Nentwig, Jun 16, 2004, in forum: XML
    Replies:
    1
    Views:
    570
    Patrick TJ McPhee
    Jun 17, 2004
  5. Johnny Ooi

    Looking A Nodes From Within Nodes

    Johnny Ooi, Nov 13, 2004, in forum: XML
    Replies:
    10
    Views:
    916
    Johnny Ooi
    Nov 14, 2004
  6. Xamle Eng

    Why treat text nodes as nodes?

    Xamle Eng, May 13, 2005, in forum: XML
    Replies:
    8
    Views:
    695
    Fredrik Lundh
    May 28, 2005
  7. Replies:
    9
    Views:
    4,673
  8. Volker Lenhardt
    Replies:
    4
    Views:
    1,268
    Volker Lenhardt
    Feb 23, 2012
Loading...