Subject: Re: [xsl] transform html h1 with a div From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Thu, 25 Oct 2012 12:15:17 +0200 |
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 h il testo dopo il titolo 2A</p> <h1>titolo 1B</h1> <p>questo h il 10 testo dopo il titolo 1B</p> <p>questo h il 20 testo dopo il titolo 1B</p> <p>questo h il 30 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 h il testo dopo il titolo 2A</p> </div> </div>
<div class="h1"> <h1>titolo 1B</h1> <p>questo h il 10 testo dopo il titolo 1B</p> <p>questo h il 20 testo dopo il titolo 1B</p> <p>questo h il 30 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?
Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] transform html h1 with a , Martin Honnen | Thread | Re: [xsl] transform html h1 with a , Giuseppe Briotti |
Re: [xsl] transform html h1 with a , Martin Honnen | Date | [xsl] Effect of default namespace s, Ihe Onwuka |
Month |