473,385 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

unique key for only nested element

Hello,

I want to have a unique Quesiton Id key for each question under
section. Not for every question in the Typed DataSet. Is there
anyway I can do this...?

Thanks, here is my typed Dataset XSD
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="TestSection" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="TestSection" msdata:IsDataSet="true"
msdata:Locale="en-GB">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Section" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Question" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Option" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="Text" type="xs:string" />
<xs:attribute name="Selected" type="xs:string" />
<xs:attribute name="Tooltip" type="xs:string" />
<xs:attribute name="Answer" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Text" type="xs:string" />
<xs:attribute name="Type" type="xs:string" />
<xs:attribute name="Score" type="xs:string" />
<xs:attribute name="Mandatory" type="xs:string" />
<xs:attribute name="Tooltip" type="xs:string" />
<xs:attribute name="MultiSelect" type="xs:string" />
<xs:attribute name="AllowNoSelection" type="xs:string" />
<xs:attribute name="Multiline" type="xs:string" />
<xs:attribute name="MaxLength" type="xs:string" />
<xs:attribute name="MinLength" type="xs:string" />
<xs:attribute name="InitialValue" type="xs:string" />
<xs:attribute name="Validation" type="xs:string" />
<xs:attribute name="Answer" type="xs:string" />
<xs:attribute name="Id" type="xs:short" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Enabled" type="xs:boolean" />
<xs:attribute name="ShowEdit" type="xs:boolean" />
<xs:attribute name="NumberOfQuestions" type="xs:string" />
<xs:attribute name="Type" type="xs:string" />
<xs:attribute name="Score" type="xs:string" />
<xs:attribute name="Text" type="xs:string" />
<xs:attribute name="Id" type="xs:short" use="required" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:key name="TestSectionKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//Section" />
<xs:field xpath="@Id" />
</xs:key>
<xs:key name="QuestionKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//Question" />
<xs:field xpath="@Id" />
</xs:key>
</xs:element>
</xs:schema>
Nov 12 '05 #1
0 1362

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter N. Schweitzer | last post by:
The function get_meta_tags reads a file or URL and returns an array, one element for each META tag in the HEAD element of the document. The keys of this array are the values of the name attribute...
3
by: Victor Engmark | last post by:
How do I define that the contents of an element should be unique only in a sub-tree of the whole XML file? In my case, I have several documents, each containing several files. The file names...
4
by: August1 | last post by:
A handful of articles have been posted requesting information on how to use these functions in addition to the time() function as the seed to generate unique groups (sets) of numbers - each group...
2
by: Miguel Isidoro | last post by:
Hi all, I am trying to include a xsd:unique element in my schema to make an attribute of an element unique at the whole document level. Consider the following xml fragment: <Form>...
2
by: pstachy | last post by:
Hi again! I have another issue. I would like the attribute of the tag <invoice> to be unique. Made the following schema but unfortunately it doesn't validate. Could someone please indicate what is...
0
by: Torsten Munkelt | last post by:
Hi, I want to write an XML-schema saying that this document <root> <edge type="special"> <target type="one"/> </edge> <edge type="special"> <target type="one"/>
1
by: cedric.louyot | last post by:
Hi, I've written a schema that looks like : <xs:schema> <xs:complexType name="myType"> <xs:sequence> <xs:element name="e1" type="T1" maxOccurs="unbounded"/> <xs:element name="e2"...
1
by: Asko Telinen | last post by:
Hi all. I´m a bit newbie writing xml schemas. Is it possible to define xml element that must have unique attribute values in same level. For example if i have a xml - document: <list>...
1
by: tthunder | last post by:
Hi @all, Please check the following XML file and XML schema definition below first: ------- XML File (full): ------- <?xml version="1.0" encoding="UTF-8"?>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.