Empty XML Tags when using XSD and SQL Server - 01-23-2004 , 02:08 AM
I have a schema that allows the following XML.
In the sql server, we have one table. In the XSD the
elements Hypertension and Diabetes are declared as followed:
<xs:element name="Diabetes" type="basiciabetesType" minOccurs="0"
So there is a selfjoin since all Data is stored in one table.
The problem is, when there are only null values for example the
diabetes fields then only an empty tag is created. I would like to
have no tag at all to be created when there is no data. At least the
child element for diabetes are not created since there is no data. But
how to avoid the creation of the empty parent tag?
Hope someone can help me out.
Re: Empty XML Tags when using XSD and SQL Server - 01-27-2004 , 10:05 PM
"MIchael Bals" <Michael.Bals (AT) web (DOT) de> wrote
is a fix for it.
Re: Empty XML Tags when using XSD and SQL Server - 02-01-2004 , 11:06 PM
If you map a row that contains only NULL fields, then there exists a row
without properties and we map it (correctly in my opinion) to an element
that represents the present row without subelements or attributes.
If you do not want to have this appear, define a view that filters such rows
and map against the view.
I hope this helps.
"Bryant Likes" <bryant (AT) suespammers (DOT) org> wrote