all groups > dotnet xml > september 2004 >
You're in the

dotnet xml

group:

validate xml?


validate xml? bo_dong NO[at]SPAM yahoo.com
9/24/2004 2:31:06 PM
dotnet xml: I can create this xml document, but can't read it from file into
XmlDocument object. It complains about the first charactor in node
name...

<123>567</123>

Re: validate xml? Zafar Abbas [MSFT]
9/24/2004 6:59:54 PM
element name checking is not a part of validation, rather XML 1.0
conformance checking. If your xml is not conformant, XML Document will not
load it.


[quoted text, click to view]

Re: validate xml? Martin Honnen
9/25/2004 3:58:16 PM


[quoted text, click to view]

If you do not comply with the well-formedness rules then your markup is
not XML and thus rejected by the parser. So the error you get is not a
validation error but a well-formedness error, your element name is not
allowed to start with a digit.

--

Martin Honnen
Re: validate xml? BD
9/26/2004 10:06:17 AM
In my project, investment transactions are organized by date (yyyymmdd).
Such as:

<Account1>
<20021231>
<buy><ibm>20</ibm></buy>
<sell><aol>100</aol></sell>
</20021231>
<20030102>
<buy><csco>200</csco></buy>
<sell><msft>100</msft></sell>
</20030102>
</Account1>

If I can load this xml into XmlDocument object, I can reference any dates
easily, such as:

If (doc["Account1"][20021231] != null) { do something...}

Now, with this xml restriction, how should I go about it?

Thanks,

Bo

Re: validate xml? Chris Lovett
9/27/2004 12:12:49 AM
Just stick the letter "d" in front of each date as the name of those
elements and then it will be proper XML.

[quoted text, click to view]

AddThis Social Bookmark Button