xsl-list
[Top] [All Lists]

RE: [xsl] flattening and re-ordering nested notes

2008-08-18 06:31:21
From: Walter Lee Davis [mailto:waltd(_at_)wdstudio(_dot_)com]
Sent: Monday, August 18, 2008 9:21 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] flattening and re-ordering nested notes

I have a book in a TEI-influenced flavor of XML. It contains many
footnotes, which may themselves contain additional footnotes. These
footnotes are coded inline in the originating text, directly following
their reference:

/publication/chapter/section/div/
      <p>Some text here and here<ref type="footnote"
target="someid">*</ref>
              <note type="footnote" id="someid">
                      <label id="lsomelabelid">* </label>
                      <p>Some note text<ref type="footnote"
target="anotherid">&#x2020;</
ref>
                              <note type="footnote" id="anotherid">
                                      <label id="anotherlabel">&#x2020;
</label>
                                      <p>A sub note for further reference</p>
                              </note>
                              goes here and here and here.
                      </p>
              </note>
              . And even more regular text here.
      </p>

What I would like to do is un-nest the notes, such that my output XML
would look more like this:

/publication/chapter/section/
      div
      div
      div
      note
      note
      note
      note*
      note*

Further complicating this process is the fact that the publication/
chapter/section part of this program cannot be guaranteed -- divs can
live at any level below publication and don't require any sort of
parent besides that.

How about after you output the div sections you do something like:

<xsl:for-each select="/publication//note">
  <!-- output note -->
</xsl:for-each>


Andy.



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