By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,024 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,024 IT Pros & Developers. It's quick & easy.

Sequence with schema designer

P: n/a
I designed a schema in VS C# 2005 Express and am wondering why it
chooses to place a sequence tag around the elements of a table. And
additionally, if I move the elements around within the table, the
sequences in the *.xsd are not rearranged, but are left as is(in the
order in which the elements were created in the table).

Being a noob to xml, I'm just wondering:
1. Why is the sequence tag automatically added?
2. Why is it not updated if I change the ordering of elements in the
designer?

This is the xsd file:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Hotkeys"
targetNamespace="http://tempuri.org/Hotkeys.xsd"
xmlns:mstns="http://tempuri.org/Hotkeys.xsd"
xmlns="http://tempuri.org/Hotkeys.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0"
FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout,
AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema"
xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
</Connections>
<Tables>
</Tables>
<Sources>
</Sources>
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="Hotkeys" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="Hotkeys"
msprop:Generator_DataSetName="Hotkeys">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Hotkey"
msprop:Generator_UserTableName="Hotkey"
msprop:Generator_RowDeletedName="HotkeyRowDeleted"
msprop:Generator_RowChangedName="HotkeyRowChanged"
msprop:Generator_RowClassName="HotkeyRow"
msprop:Generator_RowChangingName="HotkeyRowChangin g"
msprop:Generator_RowEvArgName="HotkeyRowChangeEven t"
msprop:Generator_RowEvHandlerName="HotkeyRowChange EventHandler"
msprop:Generator_TableClassName="HotkeyDataTable"
msprop:Generator_TableVarName="tableHotkey"
msprop:Generator_RowDeletingName="HotkeyRowDeletin g"
msprop:Generator_TablePropName="Hotkey">
<xs:complexType>
<xs:sequence>
<xs:element name="Title"
msprop:Generator_UserColumnName="Title"
msprop:Generator_ColumnPropNameInRow="Title"
msprop:Generator_ColumnVarNameInTable="columnTitle "
msprop:Generator_ColumnPropNameInTable="TitleColum n" type="xs:string"
/>
<xs:element name="Description"
msprop:Generator_UserColumnName="Description"
msprop:Generator_ColumnPropNameInRow="Description"
msprop:Generator_ColumnVarNameInTable="columnDescr iption"
msprop:Generator_ColumnPropNameInTable="Descriptio nColumn"
type="xs:string" minOccurs="0" />
<xs:element name="Enabled"
msprop:Generator_UserColumnName="Enabled"
msprop:Generator_ColumnPropNameInRow="Enabled"
msprop:Generator_ColumnVarNameInTable="columnEnabl ed"
msprop:Generator_ColumnPropNameInTable="EnabledCol umn"
type="xs:boolean" minOccurs="0" />
<xs:element name="VirtualKey"
msprop:Generator_UserColumnName="VirtualKey"
msprop:Generator_ColumnPropNameInRow="VirtualKey"
msprop:Generator_ColumnVarNameInTable="columnVirtu alKey"
msprop:Generator_ColumnPropNameInTable="VirtualKey Column" type="xs:int"
minOccurs="0" />
<xs:element name="KeyStateField"
msprop:Generator_UserColumnName="KeyStateField"
msprop:Generator_ColumnPropNameInRow="KeyStateFiel d"
msprop:Generator_ColumnVarNameInTable="columnKeySt ateField"
msprop:Generator_ColumnPropNameInTable="KeyStateFi eldColumn"
type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="HotkeyKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Hotkey" />
<xs:field xpath="mstns:Title" />
</xs:unique>
</xs:element>
</xs:schema>

Jun 13 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
According to the Xml Schema spec (http://www.w3.org/TR/xmlschema-1/) your
elements have to be inside one of the following containers: xs:sequence,
xs:choice, xs:all. The most frequently used one is xs:sequence. You can
always change xs:sequence to xs:choice or xs:all if you need to.

--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<sh******@cs.fsu.edu> wrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
I designed a schema in VS C# 2005 Express and am wondering why it
chooses to place a sequence tag around the elements of a table. And
additionally, if I move the elements around within the table, the
sequences in the *.xsd are not rearranged, but are left as is(in the
order in which the elements were created in the table).

Being a noob to xml, I'm just wondering:
1. Why is the sequence tag automatically added?
2. Why is it not updated if I change the ordering of elements in the
designer?

This is the xsd file:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Hotkeys"
targetNamespace="http://tempuri.org/Hotkeys.xsd"
xmlns:mstns="http://tempuri.org/Hotkeys.xsd"
xmlns="http://tempuri.org/Hotkeys.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0"
FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout,
AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema"
xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
</Connections>
<Tables>
</Tables>
<Sources>
</Sources>
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="Hotkeys" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="Hotkeys"
msprop:Generator_DataSetName="Hotkeys">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Hotkey"
msprop:Generator_UserTableName="Hotkey"
msprop:Generator_RowDeletedName="HotkeyRowDeleted"
msprop:Generator_RowChangedName="HotkeyRowChanged"
msprop:Generator_RowClassName="HotkeyRow"
msprop:Generator_RowChangingName="HotkeyRowChangin g"
msprop:Generator_RowEvArgName="HotkeyRowChangeEven t"
msprop:Generator_RowEvHandlerName="HotkeyRowChange EventHandler"
msprop:Generator_TableClassName="HotkeyDataTable"
msprop:Generator_TableVarName="tableHotkey"
msprop:Generator_RowDeletingName="HotkeyRowDeletin g"
msprop:Generator_TablePropName="Hotkey">
<xs:complexType>
<xs:sequence>
<xs:element name="Title"
msprop:Generator_UserColumnName="Title"
msprop:Generator_ColumnPropNameInRow="Title"
msprop:Generator_ColumnVarNameInTable="columnTitle "
msprop:Generator_ColumnPropNameInTable="TitleColum n" type="xs:string"
/>
<xs:element name="Description"
msprop:Generator_UserColumnName="Description"
msprop:Generator_ColumnPropNameInRow="Description"
msprop:Generator_ColumnVarNameInTable="columnDescr iption"
msprop:Generator_ColumnPropNameInTable="Descriptio nColumn"
type="xs:string" minOccurs="0" />
<xs:element name="Enabled"
msprop:Generator_UserColumnName="Enabled"
msprop:Generator_ColumnPropNameInRow="Enabled"
msprop:Generator_ColumnVarNameInTable="columnEnabl ed"
msprop:Generator_ColumnPropNameInTable="EnabledCol umn"
type="xs:boolean" minOccurs="0" />
<xs:element name="VirtualKey"
msprop:Generator_UserColumnName="VirtualKey"
msprop:Generator_ColumnPropNameInRow="VirtualKey"
msprop:Generator_ColumnVarNameInTable="columnVirtu alKey"
msprop:Generator_ColumnPropNameInTable="VirtualKey Column" type="xs:int"
minOccurs="0" />
<xs:element name="KeyStateField"
msprop:Generator_UserColumnName="KeyStateField"
msprop:Generator_ColumnPropNameInRow="KeyStateFiel d"
msprop:Generator_ColumnVarNameInTable="columnKeySt ateField"
msprop:Generator_ColumnPropNameInTable="KeyStateFi eldColumn"
type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="HotkeyKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Hotkey" />
<xs:field xpath="mstns:Title" />
</xs:unique>
</xs:element>
</xs:schema>

Jun 13 '06 #2

P: n/a
Thank you. I was just wondering if some significant purpose was served
by the fact that it defaults to requiring them to be in order. It
would seem to me that the order shouldn't matter in the relational
model, since the element tags are pretty good at telling you which
elements are which.

Stan Kitsis [MSFT] wrote:
According to the Xml Schema spec (http://www.w3.org/TR/xmlschema-1/) your
elements have to be inside one of the following containers: xs:sequence,
xs:choice, xs:all. The most frequently used one is xs:sequence. You can
always change xs:sequence to xs:choice or xs:all if you need to.

--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<sh******@cs.fsu.edu> wrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
I designed a schema in VS C# 2005 Express and am wondering why it
chooses to place a sequence tag around the elements of a table. And
additionally, if I move the elements around within the table, the
sequences in the *.xsd are not rearranged, but are left as is(in the
order in which the elements were created in the table).

Being a noob to xml, I'm just wondering:
1. Why is the sequence tag automatically added?
2. Why is it not updated if I change the ordering of elements in the
designer?

This is the xsd file:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Hotkeys"
targetNamespace="http://tempuri.org/Hotkeys.xsd"
xmlns:mstns="http://tempuri.org/Hotkeys.xsd"
xmlns="http://tempuri.org/Hotkeys.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0"
FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout,
AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema"
xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
</Connections>
<Tables>
</Tables>
<Sources>
</Sources>
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="Hotkeys" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="Hotkeys"
msprop:Generator_DataSetName="Hotkeys">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Hotkey"
msprop:Generator_UserTableName="Hotkey"
msprop:Generator_RowDeletedName="HotkeyRowDeleted"
msprop:Generator_RowChangedName="HotkeyRowChanged"
msprop:Generator_RowClassName="HotkeyRow"
msprop:Generator_RowChangingName="HotkeyRowChangin g"
msprop:Generator_RowEvArgName="HotkeyRowChangeEven t"
msprop:Generator_RowEvHandlerName="HotkeyRowChange EventHandler"
msprop:Generator_TableClassName="HotkeyDataTable"
msprop:Generator_TableVarName="tableHotkey"
msprop:Generator_RowDeletingName="HotkeyRowDeletin g"
msprop:Generator_TablePropName="Hotkey">
<xs:complexType>
<xs:sequence>
<xs:element name="Title"
msprop:Generator_UserColumnName="Title"
msprop:Generator_ColumnPropNameInRow="Title"
msprop:Generator_ColumnVarNameInTable="columnTitle "
msprop:Generator_ColumnPropNameInTable="TitleColum n" type="xs:string"
/>
<xs:element name="Description"
msprop:Generator_UserColumnName="Description"
msprop:Generator_ColumnPropNameInRow="Description"
msprop:Generator_ColumnVarNameInTable="columnDescr iption"
msprop:Generator_ColumnPropNameInTable="Descriptio nColumn"
type="xs:string" minOccurs="0" />
<xs:element name="Enabled"
msprop:Generator_UserColumnName="Enabled"
msprop:Generator_ColumnPropNameInRow="Enabled"
msprop:Generator_ColumnVarNameInTable="columnEnabl ed"
msprop:Generator_ColumnPropNameInTable="EnabledCol umn"
type="xs:boolean" minOccurs="0" />
<xs:element name="VirtualKey"
msprop:Generator_UserColumnName="VirtualKey"
msprop:Generator_ColumnPropNameInRow="VirtualKey"
msprop:Generator_ColumnVarNameInTable="columnVirtu alKey"
msprop:Generator_ColumnPropNameInTable="VirtualKey Column" type="xs:int"
minOccurs="0" />
<xs:element name="KeyStateField"
msprop:Generator_UserColumnName="KeyStateField"
msprop:Generator_ColumnPropNameInRow="KeyStateFiel d"
msprop:Generator_ColumnVarNameInTable="columnKeySt ateField"
msprop:Generator_ColumnPropNameInTable="KeyStateFi eldColumn"
type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="HotkeyKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Hotkey" />
<xs:field xpath="mstns:Title" />
</xs:unique>
</xs:element>
</xs:schema>


Jun 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.