[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Encoding/Entities problems

Subject: Re: Encoding/Entities problems
From: Mike Brown <mike@xxxxxxxx>
Date: Tue, 29 Oct 2002 11:07:55 -0700 (MST)
encoding entities
Paulo (Shape.Tech) wrote:
> i´m using mike´s exemple:
> 
> <?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
> <!DOCTYPE xsl:stylesheet [
> <!ENTITY % lat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
> "xhtml-lat1.ent">
> <!ENTITY % symbol PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
> "xhtml-symbol.ent">
> <!ENTITY % special PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
> "xhtml-special.ent">
> %lat1;
> %symbol;
> %special;
> ]>
> 
> I got the .ent files and they´re saved in my local folder. in the browser
> i´m getting this error:
> 
> O sistema não pode localizar o objeto especificado.
> %lat1;
> 
> it means:  the system can´t locate the specified object.  %lat1;

Well that is just simply a "file not found" error. I cannot reproduce it,
myself. I put the .ent files in the same directory as the stylesheet, and it
worked fine. This is with IE6 / MSXML 3, no special security settings that I 
can recall.

MSXML does have a mode where it does not resolve external entities, and 
people have problems with this sometimes, but that's not what is happening 
here.

I do not recommend using the .ent files with full "http://www.w3.org/..."
references, because in this case, the browser really would go out over the
Internet to fetch the files.

As David Carlisle said, you can do the work manually; just copy the <!ENTITY>
declarations that you need from the files and use them instead of the
parameter entities. Note that standalone="no" is no longer needed if you do it
this way. And it will always work.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY copy "&#169;">
<!ENTITY Delta "&#916;">
<!ENTITY dagger "&#8224;">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" indent="no"/>

  <xsl:template match="/">
    <html>
      <head>
        <title>test</title>
      </head>
      <body>
        <p>&copy;</p>
        <p>&Delta;</p>
        <p>&dagger;</p>
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>

Also, as David said, it's no more difficult to type "&#169;"...
Only use entities if they are really that much more convenient for you.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.