Giuseppe Briotti wrote:
The question is how to create a hierarchical div structure, based on
h1, h2, h*... html tags
As example transform this:
<?xml version="1.0" encoding="UTF-8"?>
<radice>
<h1>titolo 1A</h1>
<h2>titolo 2A</h2>
<p>questo è il testo dopo il titolo 2A</p>
<h1>titolo 1B</h1>
<p>questo è il 1° testo dopo il titolo 1B</p>
<p>questo è il 2° testo dopo il titolo 1B</p>
<p>questo è il 3° testo dopo il titolo 1B</p>
</radice>
to this
<?xml version="1.0" encoding="UTF-8"?>
<radice>
<div class="h1">
<h1>titolo 1A</h1>
<div class="h2">
<h2>titolo 2A</h2>
<p>questo è il testo dopo il titolo 2A</p>
</div>
</div>
<div class="h1">
<h1>titolo 1B</h1>
<p>questo è il 1° testo dopo il titolo 1B</p>
<p>questo è il 2° testo dopo il titolo 1B</p>
<p>questo è il 3° testo dopo il titolo 1B</p>
</div>
</radice>
I'm usign XSLT 2.0 and Saxon HE 9.4
So, what I'm missing? Can you suggest a smarter approach?
I think
http://stackoverflow.com/questions/4547271/xslt-moving-a-grouping-html-elements-into-section-levels
is exactly what you want, in case you couldn't adapt the other more
complicated grouping.
--
Martin Honnen --- MVP Data Platform Development
http://msmvps.com/blogs/martin_honnen/
--~------------------------------------------------------------------
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>
--~--