This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook] Using DocBook As Website Content!


On Fri, Oct 31, 2003 at 11:53:12PM +0100, Sina K. Heshmati wrote:
> Dear Sir,
> 
> How is it possible for me to use DocBook as the main content of my 
> website? (not necessarily DocBook Website).

But Website is an option you should look at, because you
can integrate DocBook content that has been converted to
HTML to Website.
 
> For instance, I write XHTML and CSS in order for my own options to be 
> imposed, and DocBook XML to be embedded in to my XHTML files.

I think you mean you want to embed XHTML generated from
DocBook XML, right?  Embedding XML would require the
browser to format it, and many browsers don't to that yet.
 
> Something like, PHP Manual: http://www.php.net/manual/en/. The manual 
> itself is written in XML using the DocBook XML DTD, but the output is 
> appeared across their website.

The PHP example is server-generated HTML.  As you might expect,
the PHP website uses a lot of PHP to deliver their content.
Every page you see there is the result of server-side PHP assembling
the content.

Note that all the hrefs in their HTML have ".php" suffixes,
as does the top level page index.php.  So every link you
follow generates a PHP process on the server to create
the result you see in your browser.  

To get the ".php" suffixes in the HTML, they probably set
the 'html.ext' parameter in the DocBook XSL stylesheet to
".php".  Then they wrote the PHP code to assemble each page on
the server, I presume.

Another approach might be to use the user.header.content
and user.footer.content templates in the DocBook stylesheets
to add stuff at the top and bottom of each page.  But
you won't be able to do an HTML page layout table that way.
You would need to output the opening tag of the table with
the user.header.content template, and the closing table
tag with the user.footer.content.  But XSL won't let
you do it that way.  A template cannot generate just
half of an output element.

If you have server-side includes turned on your
http server, you could output ssi instructions
with the header and footer templates:

<xsl:template name="user.header.content">
  <xsl:comment>#include virtual="/header.html"</xsl:comment>
</xsl:template>
<xsl:template name="user.footer.content">
  <xsl:comment>#include virtual="/footer.html"</xsl:comment>
</xsl:template>

mod_include won't care if header.html is just
the top of a layout table.

If, on the other hand, you can't do it with
the server and you must add the wrapper content to the 
DocBook HTML files themselves, then you could post-process
the files with a script.

I'm sure others have other approaches to this.
-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

To unsubscribe from this list, send a post to docbook-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]