This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Entities within my stylesheet.
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: Yago Alvarado <Yago dot Alvarado at uk dot cpm-int dot com>
- Cc: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 24 Sep 2002 16:50:42 +0100
- Subject: Re: [xsl] Entities within my stylesheet.
- Organization: Jeni Tennison Consulting Ltd
- References: <63542E3BFB5ED411AC2E0006298FA548058EC16A@exch_cpm.cpm-int.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Yago,
> <!DOCTYPE stylesheet [
> <!ENTITY ntilde "ñ" ><!-- small n, tilde -->
> ]>
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:output method="text"/>
>
> <xsl:template match="/">
> ñ
> </xsl:template>
>
> </xsl:stylesheet>
>
>
> I've seen this many times but I've never managed to make it work.
>
> I always get an error like:
>
> ERROR: The name of the top most element must match the name of the DOCTYPE
> declaration.
>
> Source: '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">'
> Line: 6, Pos: 80
That's because the name that you specify in a DOCTYPE declaration
must exactly match the (qualified) name that you use for the document
element in the XML document. In your case, you have:
<!DOCTYPE stylesheet ...>
and:
<xsl:stylesheet ...>...</xsl:stylesheet>
"stylesheet" and "xsl:stylesheet" aren't the same, so any XML parser
should object. Try using:
<!DOCTYPE xsl:stylesheet [
<!ENTITY ntilde "ñ" ><!-- small n, tilde -->
]>
instead and it should work.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list