You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Shawn Wilson <la...@hotmail.com> on 2001/07/06 08:25:19 UTC

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

You should be able to accomplish this as follows:

=== dummy.xml ===
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE dummyroot SYSTEM "dummy.dtd">
<dummyroot/>


=== dummy.dtd ===
<!ENTITY % thedtd SYSTEM
   "the-real-dtd.dtd">
%thedtd;

That may or may not be the exact syntax, but it should be close.


-Shawn

===============================
| Shawn A. Wilson             |
| http://www.shawn-wilson.com |
| shawn@shawn-wilson.com      |
===============================



>From: LiChao(李超) <li...@founder.com.cn>
>Reply-To: xerces-c-dev@xml.apache.org
>To: "'xerces-c-dev@xml.apache.org'" <xe...@xml.apache.org>
>Subject: Re: Check error in scan DTD--Description my question in detail--S 
>orry
>Date: Fri, 6 Jul 2001 13:52:39 +0800
>
>I feel so sorry...
>If I don't know the root of the DTD,I couldn't have built the temporary XML
>file at all.
>As I had wrote
><!DOCTYPE DOC SYSTEM "theMysteryDTDFile.dtd" >
>then *DOC* must be the root element!
>
>But how could I finish my aim if I even don't know the root? How to parse a
>DTD when I know nothing about it?
>
>-----原始邮件-----
>发件人: LiChao(李超) [mailto:lichao@founder.com.cn]
>发送时间: 2001年7月6日 13:31
>收件人: 'xerces-c-dev@xml.apache.org'
>主题: 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: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


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