[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Merging multiple XHTML documents into one

Subject: Re: Merging multiple XHTML documents into one
From: Justin Akehurst <akehurst@xxxxxxxxxxxxxxxx>
Date: Fri, 20 Feb 2004 15:56:06 -0800
merge multiple html
I came up with this XSL that seems to work, except for a few questions:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output
method="xml"
version="1.0"
encoding="iso-8859-1"
omit-xml-declaration="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

<xsl:template match="*[@id='subTemplateHere']/node()">
<xsl:apply-templates select="document('SubTemplate.html')//*[@id='subTemplate']" />
</xsl:template>


<xsl:template match="*[@id='componentHere']/node()">
<xsl:apply-templates select="document('Component.html')//*[@id='component']" />
</xsl:template>


<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()" />
  </xsl:copy>
</xsl:template>

</xsl:stylesheet>

When I run it at the command line with Java 1.4.2's XSL processor I get these lines:

Using original entity definition for "&quot;".
Using original entity definition for "&amp;".
Using original entity definition for "&lt;".
Using original entity definition for "&gt;".
Using original entity definition for "&apos;".

...for the HTML file I'm processing plus the HTML files read in with the document() call.

And, my script elements now have this xml:space attribute on them:

<script type="text/javascript"
src="http://reviews.cnet.com/html/js/rev/cms.js" xml:space="preserve">
</script>

I don't need that in my HTML.  How would I suppress it?
Is there a mode I can tell XSL to output XHTML ?

-Justin


Andreas L. Delmelle wrote:


Perhaps you want something like:

...
<xsl:template match="td[@id='subTemplateHere']">
  <xsl:apply-templates
select="document('./SubTemplate.html')//*[@id='subTemplate']" />
</xsl:template>
...
<xsl:template match="td[@id='componentHere']">
  <xsl:apply-templates
select="document('./Component.html')//*[@id='component']" />
</xsl:template>


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.