Great thanks to jas.
I am sorry for my bothering anyone here. I am a typo to XML Parser. Appologize again.
I have another two questions:
1) where can I find the FAQ maillist for xerces? I really have many questions. I want to find the answers before I bother everyone.
2) Jas' answer has solved my question perfectly, but it brings another question: How to filte the err message of "The main XML document cannot be empty"? The XML file is a temp file used to parse DTD, and I don't know anything of the DTD(even the root!!), so I can't build a complete XML file except an file only contains the prolog.
My temp XML file is like this:
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE DOC SYSTEM "f:\xml_file\doc.dtd" >
-----????-----
???: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
????: 2001?7?6? 10:42
???: [EMAIL PROTECTED]
??: Re: Check error in scan DTD
This should be a FAQ...
1) make an example XML file whose DOCTYPE uses your bogus DTD
2) Decide on your favorite Parser (SAX 1 or SAX 2 or DOM), and create
an instance of one, see DOMCount.cpp, SAXCount.cpp, or
SAX2Count.cpp for details
3) set an ErrorHandler for the parser from 2)
4) Create a LocalFileInputSource instance using the file from 1)
5) invoke Parser.parser() (from 2) on your input source (from 3) and
watch the exceptions fly...
jas.
"LiChao" <[EMAIL PROTECTED]> writes:
> I have defined a DTD like this:
>
> <!ELEMENT Root (P)>
> <!ELEMENT P (#PCDATA)>
> <!ELEMENT P (test)>
>
> Of course there are something wrong in the declaration. First, element *P*
> was defined twice. Second, element *test* was not defined.
>
> I want to use xerces to check the error. I had checked the example EnumVal,
> but I still have no idea of how to complete my aim.
>
> Any one can give me any help? Which example should I follow? Which API
> should I use? or etc.
>
> Any hint will be appreciated.
>
> Super
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
