xsl-list
[Top] [All Lists]

Re: [xsl] Re-arranging an XML file

2009-01-13 08:37:57
Mike Stroud wrote:

  Hi,

    <cd>
      <number>000002</number>
      <title>Hide Your Heart</title>
    </cd>
  </cds>
  <artists>
    <artist>
      <number>000001</number>
      <name>Bob Dylan</name>
    </artist>

I realise that I'll have to link cd/number 000001 with
artist/number 000001, but I have no idea how to go about it.

  If the current item is a cd element, the following expression will
give you the corresponding artist's name (note the use of current() to
refer to the item that "was the current item at the beginning of the
expression"):

    ../../artists/artist[number eq current()/number]/name

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/

























      


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>