>-----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]
>
> .