473,473 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Sequence with schema designer

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
2 2763
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Anders Ljusberg | last post by:
Hi! I have a problem.. I'm trying to get the XML from a dataset to conform to an XSD, but it keeps rearranging some elements. Try this schema: &lt;xs:schema id="test"...
10
by: Al Christoph | last post by:
Please forgive me if this is the wrong place to post this. The last place I posted got me a fairly rude response. I guess vb.db people just don't want to think about XML as database. At any rate,...
2
by: Lee Harr | last post by:
I must have a fundamental misunderstanding about using schema. Before using schema, I usually have a file that has my database definition, and I can play that file back in to a new database to...
15
by: Robby Russell | last post by:
I am trying to track down a method of determining what a sequence name is for a SERIAL is in postgresql. For example, CREATE TABLE foo (id SERIAL PRIMARY KEY NOT NULL, bar TEXT); \d foo...
3
by: kevin | last post by:
Is that even possible? I am creating a web service in .NET to expose some already created .NET programs to other groups. One group is writing the client in PERL, and thus wishes the wsdl schema...
1
by: Sean Burns | last post by:
Hello, I am busy creating my first XSD and folloing the examples and tutorials from "everywhere" I came up with an xsd that does the job, but I need a alternate to "sequence" because I do not...
0
by: # Cyrille37 # | last post by:
Hello, Printing a Dataset Schema Designer view is painfull. I got only bad result. I would like to know if there are applications that can open Dataset Schema Designer 's files ? Or is there...
3
by: Daniel Wilson | last post by:
I am trying to read data from MS SQL Server and turn it into an XML message to send to a remote server, as follows. sfSchemaFileDiag.FilterIndex = 2 If sfSchemaFileDiag.ShowDialog =...
0
by: nmaddock | last post by:
Hi Guys, seen this example on msdn, how can i remove the invalide nodes and elements when they fail against the schema and then save to a new xml document. any help would be great my code is...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.