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 / October 2003

Tip: Looking for answers? Try searching our database.

XML bug, what versions, etc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian - 21 Oct 2003 15:48 GMT
>-----Original Message-----
>Ian wrote:
>
>> How can I find out for certain which version my .NET
>> installation is using, and if I am indeed using version
3,
>> how can I upgrade it to version 4 to get the service
pack
>> 2? If this is what I have to do anyway.
>
>..NET doesn't use MSXML at all.
>Post more info about your issue.

the following is the XML node concerned.

<iData desc="">
  (subnodes of iData)
</iData>

But is has the DTD attribute list:

<!ATTLIST iData
    periodicity (S | C) "S"
    dropManaged (N | Y) "N"
    desc CDATA #REQUIRED
    styleModel CDATA #IMPLIED
    refModel CDATA #IMPLIED>

The result, having validated the XML with a Validating
reader and then loaded it into an XMLDocument Object, and
iterated to the node concerned, is a list of attributes
containing only the empty "desc" attribute, in the
attributes collection of the XMLNode object that contains
the relevant node. The periodicity and dropManaged
declarations in the DTD, which should be filled in by the
parser as "S" and "N" respectively, are left out.

This problem is referred to in the article whose url I put
in my first post, as a known problem of MSXML 4, fixed in
service pack 2. But it occurs in my VB.NET application and
that is what I need to know how to solve. The help for XML
in general in my .NET help often refers to Version 3,
which is what made me think I was using Version 3.

Thanks

Ian

.
Chris Lovett - 22 Oct 2003 07:06 GMT
The following code produces the right result.  Perhaps you are loading the
XmlDocument using a non-validating XmlTextReader instead of the default
XmlValidatingReader.

XmlDocument doc = new XmlDocument();
doc.LoadXml(@"<!DOCTYPE iData [
               <!ELEMENT iData (ANY)>
               <!ATTLIST iData
               periodicity (S | C) 'S'
               dropManaged (N | Y) 'N'
               desc CDATA #REQUIRED
               styleModel CDATA #IMPLIED
               refModel CDATA #IMPLIED>]>
               <iData desc=''></iData>");

Console.WriteLine(doc.DocumentElement.GetAttribute("periodicity"));

It prints "S".

> >-----Original Message-----
>
[quoted text clipped - 34 lines]
>
> .

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.