You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Hellmann Peter (ext) ICM RDC IS VDR RD" <Pe...@mch.siemens.de> on 2002/02/15 17:40:16 UTC

DOMParser does only well formed validation / parse(uri) doesn't t ake string as argument

Hi all,

could someone please give me a hint. I am using the xerces DOM parser like
this:

parser = new org.apache.xerces.parsers.DOMParser();
parser.setFeature( "http://xml.org/sax/features/validation", true );

I am parsing a xml document that refers to an external dtd. Although i
enable the
feature "validate", the parser seems only to do a "well formed" validation,
it
ignores the DTD although it checks if it exists. Am i missing something ?

However if i create a parser like this:

DOMParserWrapper parser =
(DOMParserWrapper)Class.forName("dom.wrappers.DOMParser").newInstance(); 
parser.setFeature( "http://xml.org/sax/features/validation", true );

This parser parses my xml document and validates it against the external DTD
fine. But the parse() method
only takes an URI and not a string. But i must pass my xml document as a
string because it is not on disk.
Is there a way i can solve this problem?

Thanks for any hints on this problem.


kind regards
Peter Brightman
http://www.brightman.de

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org