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 Jordan C N Chong <ch...@cs.utwente.nl> on 2001/08/24 13:31:13 UTC

How to check whether the XML document is existed?

Dear all,

Is there a way to check whether the XML document is existed before parsing
it? And, how to relate the XML document with its DTD? Please help. Thanks.
Wish you all the best.



Best regards,
--------------------------------------------
Jordan Cheun Ngen, Chong
Room 4067
Distributed and Embeded Systems Group
Centre for Telematics and Information Technology
University of Twente
Faculty Informatica
7522 NB Enschede
The Netherlands
--------------------------------------------
Office Phone: +31 53 4894655
Web site: http://www.cs.utwente.nl/~chong
Email Add.: chong@cs.utwente.nl
============================================


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


Re: How to check whether the XML document is existed?

Posted by Murray Cumming <Mu...@BetaResearch.de>.
Jordan C N Chong wrote:
> 
> Dear all,
> 
> Is there a way to check whether the XML document is existed before parsing
> it? And, how to relate the XML document with its DTD? Please help. Thanks.
> Wish you all the best.

I try to open the XML Document first by using an fstream.

And I use an EntityResolver to find the installed DTD. Here's some code
that does this:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/bakery/bakery_example_xml/src/

I find that the EntityResolver MUST check that the DTD is really there
because Xerces-C++ will not complain if the DTD is not found. You will
just have an empty DOM_Document.


-- 
Murray Cumming
www.murrayc.com
murrayc@usa.net

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