This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] website - incorporating html inside a page ?
- From: Bob Stayton <bobs at sco dot com>
- To: Marc Baaden <baaden at smplinux dot de>
- Cc: docbook-apps at lists dot oasis-open dot org
- Date: Wed, 29 Oct 2003 11:24:43 -0800
- Subject: Re: [docbook-apps] website - incorporating html inside a page ?
- References: <200310291312.OAA01200@apex.ibpc.fr>
On Wed, Oct 29, 2003 at 01:12:46PM +0000, Marc Baaden wrote:
>
> Short description: how to wrap verbatim html inside a <webpage> ?
>
>
> Hi,
>
> having solved my last problem concerning formatting and style by
> heavily tweaking my CSS stylesheet, I move on to other deeds ..
>
> . concerning existing html code, that I would like to "wrap" within
> a website page. The point being that I would like to maintain a navtoc
> on the left etc.
>
> So is it possible to include verbatim html inside a website <webpage> ?
> (Ideally at the xml level and not at the xsl one ..)
I don't know of a way to do this with just xml. You can
certainly try to include external html code using system
entities or xinclude, but once included it will be either
escaped (e.g., < becomes < ) or it will be treated
as element nodes and processed by the XSL templates.
The latter will likely fail because there will be no
templates for such <html> elements.
I was able to accomplish it using a processing instruction
and a small customization to open the html file and copy
it through to the output.
In the webpage file:
<?htmlcode insert.html ?>
In the stylesheet customization, add:
<xsl:template match="processing-instruction('htmlcode')">
<xsl:copy-of select="document(normalize-space(.),/)"/>
</xsl:template>
The text in the file must be well-formed XML, however.
Is that possible with your HTML snippet?
If not, then there is a way to fake it.
Add a wrapper element in the file, and then select
all the children of the wrapper:
<xsl:template match="processing-instruction('htmlcode')">
<xsl:variable name="code" select="document(normalize-space(.),/)"/>
<xsl:copy-of select="$code/foo/*"/>
</xsl:template>
--
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-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.