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

XML source with DOCTYPE declaration

Subject: XML source with DOCTYPE declaration
From: Zeljko Rajic <zeljko.rajic@xxxxxxxxxx>
Date: Wed, 18 Apr 2001 14:02:04 +0200
xml doctype declaration
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"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">

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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/XML/XLink/0.9">
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

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


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


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"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html>
	<head>
		<title/>
	</head>
	<body title="article">
		Some article text !!
	</body>
</html>
		

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 !!

Regards,
Zeljko

 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.