[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

How can I include my custom elements within my .xsl file and NOT cause the server-side XSL parser to choke?


Subject: How can I include my custom <!ENTITY ...> elements within my .xsl file and NOT cause the server-side XSL parser to choke?
From: Kirk Mahoney <kirkmahoney@xxxxxxxxxxxxxx>
Date: Fri, 12 May 2000 13:22:30 -0500

I have been successfully using a .xsl file to view a .xml file in IE5.

Now, I am trying to use essentially that same .xsl file / .xml file pair but
have the transformation to HTML occur at the server side instead of by IE5.

My .xsl file that works fine with IE5 doing the transformation contains this
as its first few lines:
----------
<!-- My .xsl file -->
<!DOCTYPE xsl:stylesheet [
	<!ENTITY copy  "&#169;">
	<!ENTITY fill0 "<FONT face='Verdana,Arial,Helvetica,sans-serif'
size='0'>&#160;</FONT>">
	<!ENTITY fill1 "<FONT face='Verdana,Arial,Helvetica,sans-serif'
size='1'>&#160;</FONT>">
	<!ENTITY fill2 "<FONT face='Verdana,Arial,Helvetica,sans-serif'
size='2'>&#160;</FONT>">
	<!ENTITY nbsp  "&#160;">
	]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns:html="http://www.w3.org/TR/REC-html40">
	<xsl:template match="/">
		...
----------

However, when I try to use the above .xsl file with server-side
transformation, I get this parser-error message: "The element
'xsl:stylesheet' is used but not declared in the DTD/Schema."

After I removed the <!DOCTYPE xsl:stylesheet [ ... ]> element from the
prolog of the above .xsl file and replaced all of my custom entities with
"raw" code, such that the .xsl file began like this:
----------
<!-- My .xsl file -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns:html="http://www.w3.org/TR/REC-html40">
	<xsl:template match="/">
		...
----------
I got _no_ error message with server-side transformation.

This difference in behavior suggests to me that Microsoft.XMLDOM, on the
server side, chokes with a <!DOCTYPE xsl:stylesheet [ ... ]> element in the
prolog of the .xsl file.

My question is: How can I include my custom <!ENTITY ...> elements within my
.xsl file and NOT cause the server-side XSL parser to choke?

Kirk Mahoney, Ph.D. * Prodigy Biz * kirkmahoney@xxxxxxxxxxxxxx *
281-276-7995


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



Keywords
xsl