Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loading dataset from XML with Schema
Message
From
16/03/2010 22:27:23
 
General information
Forum:
ASP.NET
Category:
XML
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01454990
Message ID:
01454991
Views:
37
>I was wondering if anybody can suggest a way around this issue.
>
>I created an XML and a schema file (.XSD). The XSD specifies types of all elements in the XML. One of the elements is boolean. The XSD also specifies the default value as following:
>
>
><xsd:element name="req_entry" default="false" type="xsd:boolean"/>		
>
>
>Everything works well.. unless the value in the element "req_entry" in the XML is empty. Then an exception is thrown saying that "The string '' is not a valid Boolean value". I thought that specifying the default value (false) in the schema file will set the value as false. But it does not. Here is the code of how I am loading the XML:
>
>
>DataSet myDataSet = new DataSet();
>myDataSet.ReadXmlSchema("MySchema.xsd");
>myDataSet.ReadXml("MyXml.xml");
>
In that dataset, do you have any null values?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform