xsl-list
[Top] [All Lists]

DTD for XML

2004-02-06 08:16:53
Situation:

I have XML files using the same DTD, but have different DOCTYPE
declarations. 

For example:
<!DOCTYPE rparticle SYSTEM
"../../DTDNorm/rpdtd/normalized/dtds/rparticle.dtd" [
<!ENTITY xxxxx ".....">
]>

<!DOCTYPE rparticle SYSTEM "rparticle.dtd" [
<!ENTITY xxxxx ".....">
]>

<!DOCTYPE rparticle PUBLIC "......" "rparticle.dtd" [
<!ENTITY xxxxx ".....">
]>

Current solution:
I tentatively put the DTD in whatever place (more than one place, of course)
the transformer asks to avoid any Exception.

Questions:
(1) I'm using javax.xml.transform.* in java servlets to do the XSLT
transformation. Is it possible to set up a
org.apache.xml.resolver.tools.CatalogResolver to manage the DTD location?

(2) or is it possible to ignore the DOCTYPE in the XML file and set up a DTD
for use by the transformer?

(3) If the above is not possible, I'm thinking of scanning the XML file and
replace the DOCTYPE declaration before processing. This just does not appeal
to me. Any other suggestion?

(4) I'm also thinking of parse the XML document first using some parser that
can do (1) and/or (2) and then do the transformation without validation (I'm
not sure in this case I still have to resolve the DTD).

Please give me some general ideas and examples if possible.

Thanks.

Peiyun Jiang



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>
  • DTD for XML, Jiang, Peiyun <=