#188 xmlwf -x not reading the external DTD

Not a Bug

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">

--- test_ext_ent.dtd ---
<!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



  • Karl Waclawek

    Karl Waclawek - 2002-08-15
    • assigned_to: nobody --> fdrake
    • status: open --> open-rejected
  • Karl Waclawek

    Karl Waclawek - 2002-08-15

    Logged In: YES

    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.


  • Michel Rodriguez

    Logged In: YES

    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?

  • Karl Waclawek

    Karl Waclawek - 2002-08-16

    Logged In: YES

    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.

  • Fred L. Drake, Jr.

    Logged In: YES

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

  • Fred L. Drake, Jr.

    • milestone: --> Not a Bug
    • status: open-rejected --> closed-rejected

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks