I wrote an application to scrape a database and create an XSD file which will be annotated
by a map file in order to create a Typed DataSet. I was wondering if I could do the annotation
using XSLT.
Here is background on Typed DataSet:
Using Annotations with a Typed DataSet
http://msdn.microsoft.com/library/de...pedDataSet.asp
I need to append an attribute a specific XML node.
Change
<xs:element name="column_1" msdata:ReadOnly="true" minOccurs="0" type="xs:short" />
<xs:element name="column_2" msdata:ReadOnly="true" minOccurs="0" type="xs:int" />
to
<xs:element name="column_1" msdata:ReadOnly="true" minOccurs="0" type="xs:short" msprop:typedName="ID" />
<xs:element name="column_2" msdata:ReadOnly="true" minOccurs="0" type="xs:int" msprop:typedName="Name" />
I have included an XSD file that was returned as a result of my application before it is annotated.
Any thoughts would be appreciated.
Cheers,
Dave
================================================== =======
<?xml version="1.0" standalone="yes"?>
<xs:schema id="DsStoredProc" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DsStoredProc" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="column_1" msdata:ReadOnly="true" minOccurs="0" type="xs:short" />
<xs:element name="column_2" msdata:ReadOnly="true" minOccurs="0" type="xs:int" />
<xs:element name="column_3" msdata:ReadOnly="true" minOccurs="0" type="xs:int" />
<xs:element name="column_4" msdata:ReadOnly="true" minOccurs="0" type="xs:short" />
<xs:element name="column_5" msdata:ReadOnly="true" minOccurs="0" type="xs:int" />
<xs:element name="column_6" msdata:ReadOnly="true" minOccurs="0" type="xs:short" />
<xs:element name="column_7" msdata:ReadOnly="true" minOccurs="0" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Table1">
<xs:complexType>
<xs:sequence>
<xs:element name="column_8" minOccurs="0" type="xs:short" />
<xs:element name="column_9" minOccurs="0" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Table2">
<xs:complexType>
<xs:sequence>
<xs:element name="column_10" type="xs:int" />
<xs:element name="column_11" type="xs:short" />
<xs:element name="column_12" type="xs:int" />
<xs:element name="column_13" type="xs:short" />
<xs:element name="column_14" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>