[xsl] Manage XHTML-Output with XSL-T

Subject: [xsl] Manage XHTML-Output with XSL-T
From: "Michael Ruck @ GMX" <cws@xxxxxxx>
Date: Mon, 27 Nov 2006 09:53:49 +0100
Hi Folks,

I have a little problem in transforming a XML-document to a XHTML-document using XSL-T.

I have the near following structure in the XML-document:

<doc><page nr="1">
<standard>Some text</standard>
<standard><p>some other text</p><standard>
<in_01><p>a list element</p></in_01>
<in_01><p>a second list element</p></in_01>
<in_10><p>a list element without dot</p></in_10>
<in_01><p>a third list element</p></in_01>
<in_02><p>list element as child of the third element</p></in_02>
<in_20><p>list element as child of the third element without dot</p></in_20>
<standard-bold><p>bold text</p></standard-bold>
<page nr="2">
<!-- here can be the similiar structure as in page 1 -->

Now I want to transform this structure to the following XHTML-Structure:

<p>Some Text</p>
<p>Some other text</p>
<li>a list element</li>
<li>a second list element<br />
a list element without dot</li>
<li>a third list element
<li>list element as child of the third element<br />
list element as child of the third element without dot</li>
<p><strong>bold text</strong></p>
<!-- now the content of page 2 follows -->

I have the following problems in my transformation:
- I cannot open a tag in an xsl:choose-xsl:when cause without closing it. So I have an output of <ul><li>...</li></ul><ul><li>...</li></ul> instead of <ul><li>...</li><li>...</ul>
- I cannot analyse the previous node (maybe I still didn't found the right function), so that I can decide if I have to open the <ul>-Tag or I have to close it.
- I cannot make an XHTML-Output like <ul><li>...<ul><li>...</li></ul></li></ul>. Here I have the similiar problem as in the first topic.

There is no way to put some additional content into the XML-File, so I have a structure like <add><in_01>...</in_01><in_01>...</in_01></add>.

I hope you can help me with my problem or give me tipps to analyse and transform the XML-File to an XHTML-File.

Thanks for your fast help.

Best regards.


Current Thread