List Info

Thread: suppressing everything but the content of in xhtml output




suppressing everything but the content of <body> in xhtml output
user name
2007-06-12 14:05:12
Hello,

I'd like to output only the content of the xhtml document's
<body> (ie, 
no <html>, <head>, or <body> tags). I
found an old post that seemed to 
be what I needed, but the XSL customization didn't work for
me (granted, 
it's 5 years old):

Subject: Re: DOCBOOK-APPS: Removing
<html>,<head> & <body>
     * From: Gisbert Amm <giawebde-ag.de>
     * To: Fredrik Svensson <fredludd.luth.se>
     * Date: Wed, 04 Sep 2002 10:21:26 +0200

  >    Currently the HTML head stuff is output by
  >    this template in html/docbook.xsl:
  >
  >    <xsl:template match="*"
mode="process.root">
  >
  >    If you only want to modify this for articles,
  >    you could add a template in mode
"process.root"
  >    to your html customization layer:

  >    <xsl:template match="article"
mode="process.root">
  >     <xsl:apply-templates
select="."/>
  >    </xsl:template>

  >    Then it will not output the
<head><body> stuff, but
  >    it will process everything in the document
  >    as html.

I'm using the DocBook 5 stylesheets, and xhtml/docbook.xsl.
Any hints?

thanks,

Brett

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


Re: suppressing everything but the content of <body> in xhtml output
user name
2007-06-12 14:12:15
OK, found another tip from 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transiti
onal.dtd">

How can I supress that as well? This content is going into
an existing 
site built with PHP.

Thanks.

On 6/12/2007 3:05 PM, Brett Leber wrote:
> Hello,
> 
> I'd like to output only the content of the xhtml
document's <body> (ie, 
> no <html>, <head>, or <body> tags). I
found an old post that seemed to 
> be what I needed, but the XSL customization didn't work
for me (granted, 
> it's 5 years old):
> 
> Subject: Re: DOCBOOK-APPS: Removing
<html>,<head> & <body>
>     * From: Gisbert Amm <giawebde-ag.de>
>     * To: Fredrik Svensson <fredludd.luth.se>
>     * Date: Wed, 04 Sep 2002 10:21:26 +0200
> 
>  >    Currently the HTML head stuff is output by
>  >    this template in html/docbook.xsl:
>  >
>  >    <xsl:template match="*"
mode="process.root">
>  >
>  >    If you only want to modify this for articles,
>  >    you could add a template in mode
"process.root"
>  >    to your html customization layer:
> 
>  >    <xsl:template match="article"
mode="process.root">
>  >     <xsl:apply-templates
select="."/>
>  >    </xsl:template>
> 
>  >    Then it will not output the
<head><body> stuff, but
>  >    it will process everything in the document
>  >    as html.
> 
> I'm using the DocBook 5 stylesheets, and
xhtml/docbook.xsl. Any hints?
> 
> thanks,
> 
> Brett
> 

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


RE: suppressing everything but the content of <body> in xhtml output
user name
2007-06-12 14:24:08
Brett,

I needed to do the same thing, but I cheated and used tidy
with the following configuration file:

show-body-only: yes
output-xhtml: yes

You can also merge <divs> and clean up other
artifacts
pretty easily.

I'm sure there's a way to do this in the transform, but if
you need a quick fix, tidy works pretty well.  If you're
not
familiar with tidy, check out tidy.sourceforge.net.

Dick Hamilton

> -----Original Message-----
> From: Brett Leber [mailto:bleber+cs.cmu.edu] 
> Sent: Tuesday, June 12, 2007 1:05 PM
> To: docbook-appslists.oasis-open.org
> Subject: [docbook-apps] suppressing everything but the

> content of <body> in xhtml output
> 
> 
> Hello,
> 
> I'd like to output only the content of the xhtml
document's 
> <body> (ie, 
> no <html>, <head>, or <body> tags). I
found an old post that 
> seemed to 
> be what I needed, but the XSL customization didn't work
for 
> me (granted, 
> it's 5 years old):
> 
> Subject: Re: DOCBOOK-APPS: Removing
<html>,<head> & <body>
>      * From: Gisbert Amm <giawebde-ag.de>
>      * To: Fredrik Svensson <fredludd.luth.se>
>      * Date: Wed, 04 Sep 2002 10:21:26 +0200
> 
>   >    Currently the HTML head stuff is output by
>   >    this template in html/docbook.xsl:
>   >
>   >    <xsl:template match="*"
mode="process.root">
>   >
>   >    If you only want to modify this for
articles,
>   >    you could add a template in mode
"process.root"
>   >    to your html customization layer:
> 
>   >    <xsl:template match="article"
mode="process.root">
>   >     <xsl:apply-templates
select="."/>
>   >    </xsl:template>
> 
>   >    Then it will not output the
<head><body> stuff, but
>   >    it will process everything in the document
>   >    as html.
> 
> I'm using the DocBook 5 stylesheets, and
xhtml/docbook.xsl. Any hints?
> 
> thanks,
> 
> Brett
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: 
> docbook-apps-helplists.oasis-open.org
> 
> 



------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )