XML Attribute
my xsd is this
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="rows">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="row">
<xs:complexType>
<xs:sequence>
<xs:element name="cell1" type="xs:string" />
<xs:element name="cell2" type="xs:string" />
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
but i am getting the following XML (using writexml from dataset)
<?xml version="1.0" standalone="yes"?>
<rows>
<row>
<id>6</id>
<cell1>Procedure</cell1>
<cell2>0FRCP</cell2>
</row>
</rows>
instead of the following:
<?xml version="1.0" standalone="yes"?>
<rows>
<row id=6>
<cell1>Federal Rules of Civil Procedure</cell1>
<cell2>0FRCP</cell2>
</row>
</rows>
if anyone knows the reason, please help me.
thanks in advance.
|