External Entities

Mitch Freed mitch@icserv.net
Fri Sep 21 14:30:02 2001


I am using:

Redhat Linux 6.2
XML-Parser-2.29
expat-1.95.2

I have a perl script using XML::Parser. I am have a character entity
© in the test.rdf file. I am using a DOCTYPE referenceing a DTD
from w3c containing the XHTML list of character entities, including
© . When I run this script from the command line, the © is
parsed from the file. When I run this script from the web, the © is
not parsed from the file. I cannot figure out, with my limited
knowledge, what the problem is.
If anyone has any information that can help me I would appreciate it
very much.

##### START charent.dtd #####

<?xml version='1.0' encoding='UTF-8' ?>
<!--
......................................................................
-->
<!-- XML-compatible ISO Latin 1 Character Entity Set for XHTML
............ -->
     This DTD module is identified by the PUBLIC and SYSTEM identifiers:

       PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
       SYSTEM
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-lat1.ent"

     Revision:  $Id: xhtml-lat1.ent,v 4.1 2001/04/10 09:34:14 altheim
Exp $ SMI

     Portions (C) International Organization for Standardization 1986:
     Permission to copy in any form is granted for use with conforming
     SGML systems and applications as defined in ISO 8879, provided
     this notice is included in all copies.
-->
<!ENTITY nbsp   "&#160;" ><!-- no-break space = non-breaking space,
U+00A0 ISOnum -->
<!ENTITY iexcl  "&#161;" ><!-- inverted exclamation mark, U+00A1 ISOnum
-->
<!ENTITY cent   "&#162;" ><!-- cent sign, U+00A2 ISOnum -->
<!ENTITY pound  "&#163;" ><!-- pound sign, U+00A3 ISOnum -->
<!ENTITY curren "&#164;" ><!-- currency sign, U+00A4 ISOnum -->
<!ENTITY yen    "&#165;" ><!-- yen sign = yuan sign, U+00A5 ISOnum -->
<!ENTITY brvbar "&#166;" ><!-- broken bar = broken vertical bar, U+00A6
ISOnum -->
<!ENTITY sect   "&#167;" ><!-- section sign, U+00A7 ISOnum -->
<!ENTITY uml    "&#168;" ><!-- diaeresis = spacing diaeresis, U+00A8
ISOdia -->
<!ENTITY copy   "&#169;" ><!-- copyright sign, U+00A9 ISOnum -->

##### END charent.dtd #####

##### START test.rdf #####

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE meta SYSTEM "/dtd/meta.dtd">
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/">
  <rdf:Description
rdf:about="http://dev.icserv.net/123test123/test.html">
    <dc:Description>
      &copy;
    </dc:Description>
  </rdf:Description>
</rdf:RDF>
 
##### END test.rdf #####

##### START SCRIPT #####

#!/usr/bin/perl -w
use XML::Parser;
use Data::Dumper;

$p = XML::Parser->new(
   Style => 'Tree',
   ParseParamEnt => 1,
   Namespaces => 1,
);
$tree = $p->parsefile('test.rdf');
print "Content-type: text/html\n\n";
warn Dumper($tree);
print Dumper($tree);

##### END SCRIPT #####

Mitch Freed
Programmer

ICServ, Inc.
310 N. 2 E. Suite 108
Rexburg ID, 83440
(208) 356-8361 ext. 31
mitch@icserv.net