Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / September 2004

Tip: Looking for answers? Try searching our database.

validate xml?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bo - 24 Sep 2004 22:31 GMT
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>

Is there a way to turn off validation during XmlDocument.Load?
Zafar Abbas [MSFT] - 25 Sep 2004 02:59 GMT
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.

> I can create this xml document, but can't read it from file into
> XmlDocument object. It complains about the first charactor in node
[quoted text clipped - 3 lines]
>
> Is there a way to turn off validation during XmlDocument.Load?
BD - 26 Sep 2004 18:06 GMT
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
Chris Lovett - 27 Sep 2004 08:12 GMT
Just stick the letter "d" in front of each date as the name of those
elements and then it will be proper XML.

> In my project, investment transactions are organized by date (yyyymmdd).
> Such as:
[quoted text clipped - 20 lines]
>
> Bo
Martin Honnen - 25 Sep 2004 14:58 GMT
> I can create this xml document, but can't read it from file into
> XmlDocument object. It complains about the first charactor in node
[quoted text clipped - 3 lines]
>
> Is there a way to turn off validation during XmlDocument.Load?

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.

Signature

    Martin Honnen
    http://JavaScript.FAQTs.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.