No one knows? If I'm not doing something wrong, I'd be confident in saying
that this is a bug in the XML parser in the framework.
"Chris Capel" <(E-Mail Removed)> wrote in message
news:Omdyl%(E-Mail Removed)...
> I have an xml schema, and one one of the attributes on one of my elements,
I
> do this:
>
> <xs:element name="class">
> <xs:complexType>
> <xs:attribute name="hasCollection" type="xs:boolean" default="true" />
> </xs:complexType>
> </xs:element>
>
> Notice that the default value of the hasCollection attribute is "true".
> However, when I read in my xml file (which is validated fine) using this
> code:
>
> DataSet ds;
> ds.ReadXmlSchema("StructDefinition.xsd");
> ds.ReadXml(inputFile);
>
> and then check the value of "hasCollection" on a DataRow that's set to a
row
> of the "class" element using this code:
>
> DataRow @class;
> if ((bool)@class["hasCollection"])
> DoSomething();
>
> I quickly find that the value of @class["hasCollection"] is DBNull.Value,
> instead of true, when the hasCollection attribute isn't set. Is there
> something I'm doing wrong?
>
>
|