You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by JonTom Kittredge <jo...@itasoftware.com> on 2003/04/03 16:38:56 UTC

Problem w/ Defining Entities in Stylesheets

I just upgraded to Xalan 2.4.D1 and I am getting errors on my
stylesheets, which worked fine with previous versions.

The errors seem to be focused on the entity definitions we have at the
top of our stylesheets. For instance, if I try to run the following
stylesheet --

    <?xml version="1.0" encoding="utf-8"?>

    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>

    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:template match="/"/>

    </xsl:stylesheet>

-- I get the following errors --

    [Error] entity-test.xsl:6:52: Element type "xsl:stylesheet" must be declared.
    [Error] entity-test.xsl:8:28: Element type "xsl:template" must be declared.

    <?xml version="1.0" encoding="UTF-8"?>

If I have a more complicated stylesheet, every single xsl element is
reported as undeclared. If I remove the DOCTYPE	declaration, then the
stylesheet parses without an error.

I believe that this DOCTYPE declaration is a perfectly XML
construction. Any hints on a fix this problem or another way to define
entities would be received gratefully. It would be a major hassle to
replace all uses of  "&nbsp;" with "&#160;", not just because we use
it in thousands of places, but because who can remember what character
160 is?

Thanks, JonTom

	JT Kittredge
	ITA Software, Inc
	Cambridge, Massachusetts

Aplogies [Re: Problem w/ Defining Entities in Stylesheets]

Posted by JonTom Kittredge <jo...@itasoftware.com>.
My problem seems to have been caused by using the wrong version of
Xalan with the right version of Xerces. (I had upgraded to Xalan
2.5.D1 -- rather than 2.4.D1, as I said in my mail -- and got confused
and was using 2.4 Xalan with Xerces 2.3.0). It all seems to be fine
now. 

Sorry, JonTom

       JT Kittredge
       ITA Software, Inc.
       Cambridge, Massachusetts

On 2003-04-03 at 09:38, JonTom Kittredge wrote:
>  I just upgraded to Xalan 2.4.D1 and I am getting errors on my
>  stylesheets, which worked fine with previous versions.
>  
>  The errors seem to be focused on the entity definitions we have at the
>  top of our stylesheets. For instance, if I try to run the following
>  stylesheet --
>  
>      <?xml version="1.0" encoding="utf-8"?>
>  
>      <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
>  
>      <xsl:stylesheet version="1.0"
>        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>  
>        <xsl:template match="/"/>
>  
>      </xsl:stylesheet>
>  
>  -- I get the following errors --
>  
>      [Error] entity-test.xsl:6:52: Element type "xsl:stylesheet" must be declared.
>      [Error] entity-test.xsl:8:28: Element type "xsl:template" must be declared.
>  
>      <?xml version="1.0" encoding="UTF-8"?>
>  
>  If I have a more complicated stylesheet, every single xsl element is
>  reported as undeclared. If I remove the DOCTYPE	declaration, then the
>  stylesheet parses without an error.
>  
>  I believe that this DOCTYPE declaration is a perfectly XML
>  construction. Any hints on a fix this problem or another way to define
>  entities would be received gratefully. It would be a major hassle to
>  replace all uses of  "&nbsp;" with "&#160;", not just because we use
>  it in thousands of places, but because who can remember what character
>  160 is?
>  
>  Thanks, JonTom
>  
>  	JT Kittredge
>  	ITA Software, Inc
>  	Cambridge, Massachusetts

Re: Problem w/ Defining Entities in Stylesheets

Posted by kl...@attbi.com.
I tried this in Xalan 2.4.1, and it worked fine. I'm not sure 
whether this is the same as  your version. Using the -v option, I 
get:

>>>>>>> Xalan Version Xalan Java 2.4.1, <<<<<<<

Anyway, are you using JDK 1.4? and have you setup the endorsed 
directories properly? 
(see http://xml.apache.org/xalan-j/faq.html#faq-N100CB)
 I had some very strange errors until I got that right.

Kevin McCarthy