Patrick Lok wrote:

> At 02:24 AM 8/30/01, you wrote:
> 
> 
>> Julia Larson wrote:
>>
>>> Please help a newbie who can't find it in the docs
>>> How do I specify a DTD to use with a DomParser instance?
>>
>>
>>
>> Supply a DOCTYPE, e.g. :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE myroot SYSTEM "myschema.dtd">
>> <myroot>
>> ...
>> </myroot>
> 
> 
> If the DOCTYPE is not in the document, is there a way to tell the 
> DOMParser to parse some dtd file before parsing the actual file?


I'm afraid that's not possible by defintion.

You can have either well formed standalone XML document without a DTD at all

or you supply the DTD file using DOCTYPE directive. If you say


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<myroot>
 ...
</myroot>

The XML parser in this case can check only whether the XML document

is well formed and that's it.

On the other hand in Xerces-C is possible to reuse DTD for multiple XML 
files which follow the same DTD definition. They can't have internal DTD 
subset in this case. Please look at the FAQ and/or archives for this topic.

Radovan

-- 

  Radovan Chytracek                  CERN Division IT/API, Geant4
  e-mail: [EMAIL PROTECTED]  WWW: http://cern.ch/chytrace
  phone:  +41 22 76 78871



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

Reply via email to