473,405 Members | 2,154 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,405 software developers and data experts.

recursive relationships in xml

hello,

I need to represent recursive relationship in xml which will be
validated by defined xml schema.

example: check.xml

<a>
<testgroup name="first" result ="pass">
<testgroup name="second">
<test name="OPEN" spec = "0"/>
</testgroup>

<test name="SHORT" spec ="1"/>
</testgroup>

<test name="CLOSE" spec ="1"/>

<testgroup name="third" result ="fail">
<test name="OPEN" spec = "1"/>
</testgroup>

</a>

so i have to write a xml schema which can validate "check.xml"

Thanks in advance.

Oct 25 '05 #1
2 1244
See below. You'll need to change attribute types to reflect the values they
can take.

<xs:complexType name="testType">
<xs:attribute name="name" use="required" type="xs:string"/>
<xs:attribute name="spec" use="required" type="xs:string"/>
</xs:complexType>

<xs:complexType name="testGroupType">
<xs:sequence>
<xs:element name="testgroup" type="testGroupType" minOccurs="0"/>
<xs:element name="test" type="testType" minOccurs="0" />
</xs:sequence>
<xs:attribute name ="name" type="xs:string"/>
<xs:attribute name ="result" type="xs:string"/>
</xs:complexType>

<xs:complexType name="aType">
<xs:choice maxOccurs="unbounded">
<xs:element name="testgroup" type="testGroupType"/>
<xs:element name="test" type="testType"/>
</xs:choice>
</xs:complexType>

<xs:element name="a" type="aType"/>

--
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

<ko**************@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
hello,

I need to represent recursive relationship in xml which will be
validated by defined xml schema.

example: check.xml

<a>
<testgroup name="first" result ="pass">
<testgroup name="second">
<test name="OPEN" spec = "0"/>
</testgroup>

<test name="SHORT" spec ="1"/>
</testgroup>

<test name="CLOSE" spec ="1"/>

<testgroup name="third" result ="fail">
<test name="OPEN" spec = "1"/>
</testgroup>

</a>

so i have to write a xml schema which can validate "check.xml"

Thanks in advance.

Oct 25 '05 #2
Thank you very much Mr.Stan kitsis

Oct 26 '05 #3

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

Similar topics

2
by: Perttu Pulkkinen | last post by:
I need to find toplevel image categories and a) number of images directly in them and b) number of subcategories directly in those topcategories. In toplevel image categories "icat_parent_id IS...
2
by: | last post by:
I'd want to make a custom class that will generate breadcrumb navigation for my site via a recursive query, e.g. Home > Page1 > Subpage 1. I've structured my database with hierarchical parent/child...
2
by: Max | last post by:
Hi. I really hope someone can help me. Going slowly insane with this problem. I have a two Access 2000 databases. One is the backend containing tables and some admin queries. The other is the...
20
by: Gary Manigian | last post by:
I have 2 tables, one-to-many, that contain bills of material(BOMs): tblBOM: lngBOMID (PK) strAssemblyPartNo strDescription tblBOMDetail: lngBOMDetailID (PK) lngBOMID (FK)
7
by: davegb | last post by:
I'm totally new to relational database design. My boss has asked me to create a database of information on the employees in our group. Seemed to me like a simple application to learn the ropes. A...
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
1
by: a_valued_employee | last post by:
My data model has many tables in many hierarchies. I believe that by using recursion, I can check for all invalid codes in the working tables that do not exist in the code tables. For example, I...
4
by: lithoman | last post by:
I have been working with objects long enough to have the basics down, but some things give me fits, and this is one of them. Brief description: I have an airplane object, and each airplane has...
31
by: matthewslyman | last post by:
I have an unusual design and some very unusual issues with my code... I have forced Access to cooperate on everything except one issue - record deletion. My form design involves a recursively...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.