OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: DOCBOOK-APPS: Overriding <para> template creates invalid HTML

(Please Cc me on followups, because I'm not directly subscribed to the
list, but I get my access through the GMANE mail-to-news gateway,
which saves on a lot of disk space!)

I seem to have stumbled upon an odd bug.  I wanted to override the
default <para> match rule, but in certain contexts, I get invalid HTML
(extra '</p>' end tags).  I then pared it down to the simplest test
case, and it turns out that even copying the *identical* para match
rule from "block.xsl" into a customization layer causes the problem.
Somehow the "unwrap.p" named-template gets defeated, causing invalid

This has been filed as bug #583335 at sourceforge:


Here is the test case, "test.xml":

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
<article condition="main">

   <para>Some problem</para>


Here is the customization layer, "test.xsl" (note this simply a
cut-n-paste of the template from block.xsl):

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 

 <xsl:output method="html" encoding="ISO-8859-1"
  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
  doctype-system="http://www.w3.org/TR/html4/loose.dtd"; indent="no"/>

 <xsl:template match="para">
  <xsl:variable name="p">
    <xsl:if test="position() = 1 and parent::listitem">
     <xsl:call-template name="anchor">
      <xsl:with-param name="node" select="parent::listitem"/>
    <xsl:call-template name="anchor"/>
   <xsl:when test="$html.cleanup != 0">
    <xsl:call-template name="unwrap.p">
     <xsl:with-param name="p" select="$p"/>
    <xsl:copy-of select="$p"/>


and here is the output (this fails a validation check at

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type"><title>test</title><meta name="generator" content="DocBook XSL Stylesheets V1.52.2"></head><body bgcolor="white"
text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div
class="article"><div class="titlepage"><div><h2 class="title"><a
class="itemizedlist"><ul type="disc"><li><p><b>title. </b><p>Some

With the following message:

 Below are the results of attempting to parse this document with an
 SGML parser.

    * Line 2, column 50:

... "disc"><li><p><b>title. </b><p>Some problem</p></p></li></ul></div></ ...

      Error: end tag for element "P" which is not open; try removing
      the end tag or check for improper nesting of elements

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC