xsl-list
[Top] [All Lists]

[xsl] Keeping track of processed nodes, to avoid redundant output.

2007-09-11 03:41:43
Hello,

This is a simplified description of what I am trying to do, I have an
xml document like this:

<main>
  <someElement>
    <anElement name="John" />
  </someElement>
  <someElement>
    <anElement name="Jane" />
  </someElement>
  <someElement>
    <anElement name="John" />
  </someElement>
  <someElement>
    <anElement name="Jane" />
  </someElement>
</main>


and I like to retrieve each 'name' attribute from 'anElement', but I
only want to process the name once. So if the 'John' attribute is
repeated I want to somehow keep track that I have already processed
it, hence there is no need to process it again.

So for the given example I like to output something like:

<out>
  <name>John</name>
  <name>Jane</name>
</out>


Thanks,
John

--~------------------------------------------------------------------
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>