xsl-list
[Top] [All Lists]

Re: Is there a way to display entities callouts in both IE and Mozilla?

2004-11-09 14:18:10
Hi Wendell,

Thanks for the help.  I did try:
also tried with the ascii values for the entity callouts as well and got the 
same results:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="styles/mozilla.xsl" type="text/xsl"?>
<!DOCTYPE chapter SYSTEM "dtd_files/userdoc.dtd" [
<!ENTITY mdash SYSTEM "&#x2014;">
<!ENTITY ndash SYSTEM "&#x2013;">
<!ENTITY sol   SYSTEM "&#x002F;">
<!ENTITY ldquo SYSTEM "&#x201C;">
<!ENTITY rdquo SYSTEM "&#x2014;">
<!ENTITY rsquo SYSTEM "&#x0027;">
]>
<chapter id="T01"><title> Using text</title>
<sect1 id="T01-01"><title>Overview</title>
<para>The text text text &mdash; text text text .</para>
<para>This chapter describes the following:</para>

Opens fine in Mozilla and firefox, but errors when trying to open with IE6.

Error I'm getting from IE6
Error while parsing entity 'rsquo'. Could not load '''.
The system cannot locate the resource specified.
Error processing resource 
'file:///J:/jtext/mozilla_tst_xml/mozilla_xml/ch1_efb.xml'. Line 40, Position 1

<chapter id="T01"><title> Using the EFB</title>
^

I'm at a loss, all help is greatly appreciated.

Betty






Wendell Piez <wapiez(_at_)mulberrytech(_dot_)com> on 11/09/2004 12:51:29 PM

Please respond to xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com

To:    xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
cc:

Subject:    Re: [xsl] Is there a way to display entities callouts in both
       IE and Mozilla?


Hi Betty,

At 11:07 AM 11/9/2004, you wrote:
I am trying to use entity calls (example &mdash;) from 1 xml source for
both IE and Mozilla. Currently the IE version works fine due to the entity
files being called out from the dtd. I am having issues with the Mozilla
version.  I can not get it to recognize the &mdash.  I have tried to
declare the entity in a stylesheet using:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE xsl:stylesheet [
      <!ENTITY mdash "&#151;">
]>

this did not work.
Am I missing something?

Yup: it's not the stylesheet that contains the entity that must be
resolved, but the document. So your DOCTYPE declaration needs to be in the
document.

Just copy the same code to the top of your document, changing
"xsl:stylesheet" to the name of your document ("root") element.
Unfortunately (this gets me all the time) you have to have this in your
document because, unlike IE, Mozilla doesn't read the external DTD subset
(the part referred to in the SYSTEM or PUBLIC identifier). You can get
around this by having the entity declaration in an internal subset (the
bracketed part of the DOCTYPE declaration).

You can perfectly well have both internal and external subsets, so your
document could have

<!DOCTYPE document SYSTEM "../DTD/document.dtd [
       <!ENTITY mdash "&#151;">
]>
<document>...</document>

and it would work fine even though the mdash is declared twice.

Declaring it in the stylesheet doesn't work because the declaration is
needed when the source document, not the stylesheet, is parsed.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--