This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Unwrapping trees


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@Sun.COM   | 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]