Title: Re: Check error in scan DTD--Description my question in detail

Hi,jas

Maybe I hadn't descripted my question clearly.

I have a DTD file. I don't know the content of the file. I don't know which is the root of the DTD. Now I want to use xerces to check the syntax of the file.In order to use the SAXParser as Jas suggested,I built a temporary XML file as the following:

<?xml version="1.0" ?>
<!DOCTYPE DOC SYSTEM "theMysteryDTDFile.dtd" >

Because I know nothing about the DTD except its file name, I can't build a complete XML file.

Everything works well and I have parsed the DTD as I hoped.But new question arises...

Is there any trick to filtrate the err message of "The main XML document cannot be empty"?

Thanks a lot.

Super

> 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" >

simply add the tag <DOC/> after that.

The error message told you that you have a blank document (you just
had the XML Declaration and the Doctype, but no xml tags. That's an
error.

<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE DOC SYSTEM "f:\xml_file\doc.dtd" >
<DOC/>

The FAQ isn't really going to help with these kinds of questions. I
would get a basic book on XML to start.

jas.

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

Reply via email to