[xsl] XML source with DOCTYPE declaration

Subject: [xsl] XML source with DOCTYPE declaration
From: Zeljko Rajic <zeljko.rajic@xxxxxxxxxx>
Date: Wed, 18 Apr 2001 14:02:04 +0200
Hi there,

I am new to XSLT an hope somebody out there can help me with my problem:

I got some XML files I have to transform using XSLT. These XML files did
not contain a DOCTYPE declaration. I made the XSLT stylesheet as it was
requested and everything worked fine.
Then I added a DOCTYPE declaration to the XML file. As it is an XHTML
Basic document, I added:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"

After inserting the DOCTYPE declaration, the XSLT transformation did not
work anymore: as result I receive an 'empty page'!  :(   After some
testing it seems my template for the first element (<html>) isn't being
called anymore !!  :(

My stylesheet basically looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

	<xsl:template match="/">
		<xsl:apply-templates select="/html/body"/>

	<xsl:template match="node()[@title='article']">
		<xsl:text>Article Found !!!</xsl:text>

The XML file that should be transformed basically looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
	<body title="article">
		Some article text !!

Before I forget: I am using Xalan J 2.0.0 on Windows 2000.

Does anybody can tell me why the transformation works well without a
DOCTYPE in the source XML file, and why the transformation fails when
the XML source file contains a DOCTYPE??
Are there any points I have to attention to when using DOCTYPE or
restrictions I am not aware of??

Any suggestions and tips are highly appreciated !!


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

Current Thread