In general, suppressing <p> in listitem output would be a problem because a listitem
can contain any number of para or block elements, and they need some HTML elements
like <p> to separate them.
However, in the case of a single para in a listitem, you can suppress the <p> tags
with the following customization for orderedlist:
<xsl:template match="orderedlist/listitem/para
[count(preceding-sibling::*) = 0 and
count(following-sibling::*) = 0]">
<xsl:apply-templates/>
</xsl:template>
and something similar for itemizedlist. This template will be used on a listitem/para
when it has no sibling elements. It skips generating the <p> tags and just outputs
the content of the para.
Bob Stayton
Sagehill Enterprises
[email protected]
----- Original Message -----
From: "Tao Wang" <[email protected]>
To: <[email protected]>
Sent: Wednesday, May 12, 2010 11:49 PM
Subject: [docbook-apps] How to generate <li><a href="xx">..</a></li>?
Hi,
I'm using docbook 4.5 xhtml stylesheet xsl to generate html files. I
want to have a list of links, which should be:
-------------------
<li><a href="xxx">...</a></li>
<li><a href="xxx">...</a></li>
<li><a href="xxx">...</a></li>
-------------------
So, I use
============
<listitem><para><ulink url="xxx">...</ulink></para></listitem>
<listitem><para><ulink url="xxx">...</ulink></para></listitem>
<listitem><para><ulink url="xxx">...</ulink></para></listitem>
============
However, it generates following result
============
<li><p><a href="xxx">...</a></p></li>
<li><p><a href="xxx">...</a></p></li>
<li><p><a href="xxx">...</a></p></li>
============
I do not want <p> there. How can I generate the list of links without <p>?
--
Regards
Tao Wang
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]