PDA

View Full Version : XML parsing character entity error 4 FF


newgal
11-07-2005, 07:48 PM
Hi
I don't know what happened with my first attempt to post this (got lost in cyberspace somewhere I suppose :() but here I go again. I am trying to use character entity references in a DTD file. Everything works just fine in IE but for some reason in Firefox(FF) I get an error message:
XML Parsing Error: undefined entity
Location: jour.xml
Line Number 466, Column 52:

Here are the entities:
<!ENTITY reg "®">
<!ENTITY copy "©">
<!ENTITY trade "&#x2122;">
<!ENTITY apos "&#x27;">

Strangely enough, if I use the coding rather than the reference everything is fine in both browser. :confused: I have trouble keeping the entities straight so the references would make things faster. :o
Is this a FF problem? Have I done or not done something? :confused: Is there a fix? Or will I have to begin a cheat sheet for the entities? :thumbsup:

In trying to fix this I wonder if I need to put the DTD back in the XML file? Is that the only way FF will recognize the references? Can I only put the entities in the XML and have the DTD file also? I am so new at XML, XSLT, DTD, XSL-FO, and X-Path. I have had a wonderful and wonder-filled time learing to make all of these work properly. I am getting better but this not working is driving right up the wall. Figured it was time to look to those with more experience.

Thanks for your help!
cb -the newgal

Alex Vincent
11-08-2005, 03:55 AM
Maybe there's another entity you missed. Can you give us both the offending line and the first few lines of your XML document? (Up to the first element tag of the document.)

liorean
11-08-2005, 03:38 PM
Hmm, as I remember, Firefox doesn't read DTDs. It checks the PublicID and SystemID of the DOCTYPE towards it's internal pseudo-DTD set, and then continue parsing the document in a non-validating manner. If the document contains inline DTD with entities they will be available, but it doesn't at all read external DTDs. All in accordance with the XML spec.

newgal
11-08-2005, 08:08 PM
Hi Alex and Liorean,
I only used those 4 entity references in this document group. Once I started having trouble I put the entities together to keep track of them. I generally do that anyway but I made sure once I started having problems with them.
I did not know that FF does not read the external DTDs. That certainly explains the problem.:thumbsup:
Awww Gee.....whine whine whine....
That makes external DTDs worthless for FF. Hmmm. If it reads the inline ones then I guess for any others in this group of XML files I am going to have to make inline rather than external. I put the stuff I used repeatedly for this group of XMLs together in a DTD because the XML file was so large. Guess it's the cheat sheet for me for this group of files for now.
I am glad that the coding works at least in both browsers. I would be really whiny otherwise..... LOL
Thanks for your help.

cb aka the newgal