Re: [xsl] XML source with DOCTYPE declaration

Subject: Re: [xsl] XML source with DOCTYPE declaration
From: Zeljko Rajic <zeljko.rajic@xxxxxxxxxx>
Date: Mon, 23 Apr 2001 15:29:49 +0200
Hi Jeni,

I can't use the second suggestion as it uses XSLT extensions.  :(  The
stylesheet(s) should work with any XLST processor.

It's really hard to believe that such a 'trivial' thing is causing such
'sophisticated' stylesheets!!  :(

A solution I was thinking of looks something like this (not in XSL
syntax):

1. If DOCTYPE used, then "$xmlnsprefix = 'html'", else "$xmlnsprefix =
'html'"
2. Doing template matches like this:
	<xsl:template match="{$xmlnsprefix}:html">       or
	<xsl:template match="{$xmlnsprefix}:body">

But I have no idea how to check in the stylesheet if a DOCTYPE was used
in the XML file which is going to be transformed. And I'm not sure if
the <xsl:template match.../> tag would work as described/intended
above??

Is it possible that I'm the first with this problem??  Somehow I can't
believe this.

Anyway, another unwanted behaviour is, that the namespace attribute is
added to every tag in the output file when the source XML file contains
the DOCTYPE:

<h1 xmlns:html="http://www.w3.org/1999/xhtml";>  or  <p
xmlns="http://www.w3.org/1999/xhtml"/>

Is there a way to avoid this??


Again thanks for your great support !!  :)

- Zeljko

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


Current Thread