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: Re: DOCBOOK-APPS: HTML stylesheets emit warnings when <para> used asroot element

On Fri, Oct 18, 2002 at 12:10:01PM +0100, Kevin.Ruscoe@ubsw.com wrote:
> Hi
> 1) Given the following document:
> ============================================
> <?xml version='1.0'?>
> <!DOCTYPE para PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "docbookx.dtd"
> [
> <!ENTITY % xinclude PUBLIC "-//UBS//CORE//DTD XInclude V1.0//EN" "xinclude.dtd">
> %xinclude;
> ]
> >
> <para id="panel">
>   <xi:include href="panel_common.dbk#xpointer(/para/child::*)"/> 
>   <ulink url="/home/overview.html"><emphasis>OVERVIEW</emphasis></ulink>
>   <ulink url="/overview/features.html">Features</ulink>
>   ...snip - several more, similar lines...
> </para>
> ============================================
> xmllint validates the file with no errors, so the use of <para> as a root element is valid.
> Out of curiosity, is there an easily accessible list of valid root elements in DocBook?

I don't think there are any restrictions on which elements
can be a root element.  However, as you learned, the
stylesheets don't necessarily support any element as 
a root element.  This would be especially true in XSL-FO
where page sequence have to be started.
> 2) When I run xsltproc against the document, I get the following warning:
> "No template named "para" exists in the context named "title" in the "en" localization."
> (although correct HTML is produced nonetheless).

That message is produced by the template named
'head.content' in html/docbook.xsl as it tries to
generate an HTML <TITLE> element for inclusion
in the HTML <HEAD>.  A para has no title, and that
is what it is reporting.  The message itself
comes from the template named 'gentext.template'
in common/l10n.xsl.

> Do people agree that this counts as a bug in the
> stylesheets?  If so, I will raise a bug report.

> 3) For interest, and in case the response is "Well, it may be valid, but is it not a rather odd thing to do?" :-) perhaps I should explain our use of such documents...
> Previously, we used to maintain panels for the various parts of our websites in HTML and keep them fixed on the page using frames.  Now that we have migrated all of our websites to DocBook, these panels are kept as DocBook source.  For all DocBook pages, we keep the panels fixed on the page by using CSS2 Fixed Positioning (see http://www.w3.org/TR/REC-CSS2/visuren.html#fixed-positioning).  So, each page XIncludes the appropriate panel.  However, certain areas of our websites are outside of our control and hence cannot be written in DocBook.  To maintain a fixed panel for those areas, we need to retain our frame-based approach.  This requires us to generate HTML files from the panels themselves, to be used by the frame-based areas.
> It is true that we could code around the warning by wrapping every panel document in an <article> tag (say) and modifying the XInclude statements to say
> <xi:include href="panel_home.dbk#panel"/>
> instead of just
> <xi:include href="panel_home.dbk"/>
> but we would prefer to leave things as they are.
> My tool chain is as follows:
> DocBook DTD v4.2
> DocBook XSL v1.56.1
> libxml2 v2.4.22
> libxslt v1.0.20

Well, a document that consists of just a paragraph
is a bit unusual.  It is unusual enough to suggest
that a customization would be in order.  You could
suppress the message with an empty template in a
customization layer:

<xsl:template match="para" mode="object.title.markup"/>

In your framed environment, you probably don't need
an HTML <TITLE> element in these fragments anyway.


Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com

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

Powered by eList eXpress LLC