On Sat, 20 Sep 2003 20:45:21 +0300, Oleg Tkachenko
<oleg@NO_SPAM_PLEASEtkachenko.com> wrote:
Jeff Gaines wrote:
As a first step I am writing an XML editor (rather like an ini editor)
so I can learn how this works. I have the following line:
try
{
txtXMLName.Text = xmlRead.Name;
The problem is that in reading an XML file that doesn't have a'Name'
the app raises an exception and stops, even though it is in a 'try'
block.
If xmlRea? is XmlReader, then Name property of course always exists.
Hmm, this is too bizarre, show us more code - what is xmlRead?
<?xml version="1.0" encoding="Windows-1252"?>
<!-- JG Config File -->
<!-- Modify at Your Peril :-) -->
<Map JDATADIR="E:\Data\DataBase" JINFODIR="E:\Data\JHelp" />
and if the entry 'Map' is missing I get the error outlined above.
Any XML document must have single root element. If Map element is
missing, such XML is not wellformed and cannot be processed.
Hi Oleg, thanks for your reply.
I have now discovered the error arises just before I enter the 'try'
block so all is actually working as expected - i.e. not working :-))
I was hoping to treat an XML file like an ini file and just pull a
value out from a key name but it seems slightly more tricky than that
although I think I am making progress.
Thanks again for your reply.
--
Jeff Gaines Damerham Hampshire UK