[Expat-discuss] undefined entity - how can i fix it ?

Karl Waclawek karl at waclawek.net
Mon Nov 15 06:36:31 CET 2004


You are right, in general, an XML document does not need a DTD.
However, in order to declare an entity, you must do this in the DTD
(internal or external subset). The document you are trying to parse
is simply not well-formed and you won't be able to parse it with
any conforming XML parser. All I can say is: fix the document.

Karl
 
----- Original Message ----- 
From: "Golibasku" <ceo at absoft-net.com>
To: <expat-discuss at libexpat.org>
Sent: Monday, November 15, 2004 12:30 AM
Subject: Re: [Expat-discuss] undefined entity - how can i fix it ?


> Are you sure ? all the RSS in the Internet don't have DTD declared in the 
> xml file (internal / external). But all the xml parser (of course the parser 
> don't have critical bugs) can parse them without error. I think well-formed 
> XML document doesn't need to have a DTD. A "VALID" XML document need to have 
> DTD.
> 
> But anyway, I am not a student or teacher. I am not teaching XML 101. That's 
> why I don't want to argue on the definition problem. I only need to write a 
> program to parse the xml file. Is there any example in expat which show how 
> to parse such XML document.?
> 
> 
> ----- Original Message ----- 
> From: "Karl Waclawek" <karl at waclawek.net>
> To: "Golibasku" <ceo at absoft-net.com>; <expat-discuss at libexpat.org>
> Sent: Monday, November 15, 2004 1:12 PM
> Subject: Re: [Expat-discuss] undefined entity - how can i fix it ?
> 
> 
>> If your file does not have a DTD then obviously it is missing
>> the entity declaration and is therefore not well-formed.
>> This means - strictly speaking - it does not conform
>> to the definition of an XML document, and no conforming
>> parser will accept it.
>>
>> ----- Original Message ----- 
>> From: "Golibasku" <ceo at absoft-net.com>
>> To: <expat-discuss at libexpat.org>
>> Sent: Sunday, November 14, 2004 11:13 PM
>> Subject: Re: [Expat-discuss] undefined entity - how can i fix it ?
>>
>>
>>> Can you give me more information ? My XML don't have any DTD, i just want 
>>> to use expat to get the content from it.
>>>
>>>> Did you declare this entity in the DTD?
>>>> If not, that is what you need to do, since in XML there are only
>>>> very few predefined entities.
>>>>
>>>> ----- Original Message ----- 
>>>> Subject: [Expat-discuss] undefined entity - how can i fix it ?
>>>>
>>>> Dear all,
>>>>    in my xml document, there is a line which contains "&copy;" - no 
>>>> quote. Expat told me "undefined entity at line ...". It is the copyright 
>>>> symbol. How can i parse the document successfully ?
>>>
>>> _______________________________________________
>>> Expat-discuss mailing list
>>> Expat-discuss at libexpat.org
>>> http://mail.libexpat.org/mailman/listinfo/expat-discuss
>>>
>> 
> 
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss
>


More information about the Expat-discuss mailing list