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. Advertising

  2. use copy-of not value-of


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

  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. Advertising

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:
    440
    Arnaud Berger
    May 23, 2005
  2. Michael Reiche
    Replies:
    3
    Views:
    10,855
    Michael Reiche
    Feb 5, 2004
  3. Xamle Eng

    Why treat text nodes as nodes?

    Xamle Eng, May 13, 2005, in forum: XML
    Replies:
    8
    Views:
    497
    Fredrik Lundh
    May 28, 2005
  4. Replies:
    9
    Views:
    4,305
  5. Volker Lenhardt
    Replies:
    4
    Views:
    1,013
    Volker Lenhardt
    Feb 23, 2012
Loading...

Share This Page