Hi,

I need some advice on how to deal with a problem that I have 
encountered trying to use xerces to parse external entities
in multifile documents created by Arbortext's Epic editor.

The documents in question are technical manuals consisting of a book
file that references a set of chapter files as external entities
defined by the book's doctype declaration.  The chapter files are
themselves XML files, i.e., XML "fragments" of the book. At the head
of each chapter file is an XML comment that encloses a doctype
declaration that specifies the same doctype as that defined by the
book files doctype declaration, i.e., the book's document type.

The problem occurs when writers use Epic to "include" external text
files (usually nonXML program listings) in a chapter file.  Epic
implements this by inserting an entity definition for the inserted
file in the commented out doctype declaration at the head of the
chapter file and a reference to the entity where the inserted 
text is to appear. When displaying the chapter, Epic knows to
look for the definition of the entity in the commented out
doctype declaration. However, xerces does not. It regards the
external entity as undefined and errors out, preventing me from
parsing the file.

How can I parse such files? I've noticed that the DOMParser class
has setEntityResolver() and getEntityResolver() methods. This
suggests to me that it might be possible for me to define and use my
owe external entity resolver. This resolver would try to use the
default resolver and if that failed would look for a definition of the
entity in the commented-out doctype declaration at the head of the
file. Does the setEntityResolver method actually support such 
a solution? Is there a better way to resolve this problem? Any
help you can give me would be deeply appreciated.

- Paul


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to