[xsl] Unwrapping trees

Subject: [xsl] Unwrapping trees
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: Thu, 13 Jun 2002 10:56:25 -0400
Has anyone written the XSLT required to "unwrap" nested links?

I'd like to turn, for example:

<p>
  text
  <a href="1">
    text
    <span>
      <a href="2">test</a>
      text
    </span>
    text
  </a>
  text
</p>

into

<p>
  text
  <a href="1">
    text
    <span/>
  </a>
  <span>
    <a href="2">test</a>
    text
  </span>
  <a href="1">
    text
  </a>
  text
</p>

With extra bonus points for discarding the empty span (if it doesn't
have an ID :-)

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@xxxxxxx   | Wisdom is only a comparative quality, it will
XML Standards Engineer | not bear a single definition.--Marquess of
XML Technology Center  | Halifax
Sun Microsystems, Inc. | 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread