[Expat-bugs] [ expat-Bugs-595532 ] xmlwf -x not reading the external DTD

noreply@sourceforge.net noreply@sourceforge.net
Mon, 26 Aug 2002 14:28:33 -0700


Bugs item #595532, was opened at 2002-08-15 10:25
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=595532&group_id=10127

Category: None
>Group: Not a Bug
>Status: Closed
Resolution: Rejected
Priority: 5
Submitted By: Michel Rodriguez (mirod)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: xmlwf -x not reading the external DTD

Initial Comment:
xmlwf test_ext_ent.xml gives me an error on an
undefined entity despite it being defined in the
(external) DTD

>xmlwf -x test_ext_ent.xml
test_ext_ent.xml:2:5: undefined entity

--- test_ext_ent.xml ---
<?xml  version="1.0"  standalone="no"?>
<!DOCTYPE doc SYSTEM "test_ext_ent.dtd">
<doc>&ent;</doc>

--- test_ext_ent.dtd ---
<!ELEMENT doc (#PCDATA)>
<!ENTITY ent  'expanded entity'>

It has no problem if I do xmlwf -p test_ext_ent.xml

Shouldn't -x find the entity declaration in the DTD?

That's with expat 1.95.4

--
Michel

----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-08-26 17:28

Message:
Logged In: YES 
user_id=3066

Karl's right -- xmlwf is doing the right thing already.

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2002-08-16 09:20

Message:
Logged In: YES 
user_id=290026

Maybe, but that is a matter of specifications, not a bug.
Consider this: external entity references can be anything,
not just references to files. You could have an URL, or 
some Public Id for instance. But xmlwf only provides 
external entity reference resolution for files.

>From that point of view it makes actual sense that it is 
turned off by default, and consequently, external entity
reference resolution should only be turned on if you 
know that all external references in your xml document
can be resolved as files.

----------------------------------------------------------------------

Comment By: Michel Rodriguez (mirod)
Date: 2002-08-16 01:24

Message:
Logged In: YES 
user_id=72556

Don't you think that using xmlwf with no options on a
well-formed xml file
should not return an error, even if the file is not standalone?

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2002-08-15 11:14

Message:
Logged In: YES 
user_id=290026

I am not the expert on xmlwf, but by looking at
the code, it appears that parameter entity parsing is
turned off when -p is not specified.

Since Expat considers an external DTD a parameter
entity - check reference.html - it will consequently
not read it. Therefore the entity  declaration for &ent;
will be missing. Btw, -p implies -x, AFAIK.

This is not a bug, as far as I can tell, but
I leave it open for Fred to comment.

Karl

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=595532&group_id=10127