JDOM and external entities

Discussion in 'Java' started by Tom, Sep 10, 2005.

  1. Tom

    Tom Guest

    Ok, I really tried hard to find a solution by myself, but now it's
    late, I'm tired and I still need help!

    I need to modify a DocBook file with several other XML files included
    as an ENTITY reference. Like
    <!DOCTYPE book SYSTEM "PathToMyDTD" [
    <!ENTITY file1 SYSTEM "file1.xml">
    <!ENTITY file2 SYSTEM "file2.xml">
    <!ENTITY file3 SYSTEM "file3.xml">
    ]>
    ...
    &file1;
    &file2;
    &file3;
    JDOM's normal behaviour is to build this document with all entities
    expanded. But how will I save the individual files after modification?
    That's why I turned of entity expansion with setExpandEntities(false)
    and build each file as a separate document. Now I am faced with the
    fact, that some of those external XML files contain itself some of
    those entity references declared in my root document. But without the
    declaration I get a "Entity ... referenced, but not declared" error.
    How should I handle this?

    __
    Tom
     
    Tom, Sep 10, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wendy S
    Replies:
    1
    Views:
    6,410
    Darren Davison
    Aug 5, 2003
  2. Bernd Oninger
    Replies:
    4
    Views:
    12,454
    GIMME
    Jun 21, 2004
  3. Tinker
    Replies:
    4
    Views:
    5,374
    Harry Bosch
    Oct 9, 2005
  4. Bernd Oninger
    Replies:
    3
    Views:
    2,900
    GIMME
    Jun 21, 2004
  5. Tom
    Replies:
    0
    Views:
    474
Loading...

Share This Page