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] | [List Home]

Subject: Re: [docbook-apps] website - incorporating html inside a page ?

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 &lt; ) 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(.),/)"/>

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/*"/>


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

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