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

Subject: RE: How can I include my custom <!ENTITY ...> elements within my .xsl file and NOT cause the server-side XSL parser to choke?
From: Jonathan Marsh <jmarsh@xxxxxxxxxxxxx>
Date: Fri, 12 May 2000 12:10:57 -0700
MSXML is a validating parser by default.  You can turn this off by setting
xsldoc.validateOnParse=false.  When browsing XML files in IE5,
validationOnParse=false.

Or you can create a full content model for the stylesheet document so that
it passes validation on the server - but that's a big project.

 - Jonathan Marsh
   Microsoft

> -----Original Message-----
> From: Kirk Mahoney [mailto:kirkmahoney@xxxxxxxxxxxxxx]
> Sent: Friday, May 12, 2000 11:23 AM
> To: 'XSL-List@xxxxxxxxxxxxxxxx'
> Subject: How can I include my custom <!ENTITY ...> elements within my
> .xsl file and NOT cause the server-side XSL parser to choke?
> 
> 
> 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
> 


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


Current Thread