I'm trying to build a dataset out of an XML File and an XSD scheme file, but I need the Scheme to change some of the data in the XML DataSet.
For example, I have an empty field in the XML file ("<Price></Price>") but I need my dataset to contain a decimal value of 0.0 for this field if the XML tag is empty. I need to somehow change the value in the dataset in these case to 0.0. When trying to use a decimal element in the XSD scheme, I get the "Input string was not in a correct format" error because it's trying to convert an empty string to decimal. Strangely, if this was an int, there wouldn't be an error..
The commands I'm using are simply:
The XSD scheme has the "default" and "fixed" attributes, but as far as I understand, they only take place when the tag is missing from the XML File, not when it is empty.
The ultimate goal is to have a XML generated dataset with the correct decimal type and default value of 0 when the XML has an empty tag.
Can anyone please help?
View Complete Post