473,698 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to model data in XML?

I am storing information about community groups. Each group has an XML file
in a collection in eXist.

For each community group I need to be able to store its template type and
then a set of information about services provided.

Each template type has a different set of associated ServiceGroup's.
Each ServiceGroup has a different set of Service's.
Each Service has a different set of possible values.

The original data held in SQL Server looks like this -

Temlate Type Goup Name
Service Name Service Value
=============== =============== =============== =============== =============== =======
"Adaptation s and Maintenance Services" "Beneficiar ies"
"Carers" Yes
"Adaptation s and Maintenance Services" "Beneficiar ies"
"Carers" No
"Adaptation s and Maintenance Services" "Beneficiar ies"
"Carers" Unknown
"Adaptation s and Maintenance Services" "Beneficiar ies"
"Adults" Yes
"Adaptation s and Maintenance Services" "Beneficiar ies"
"Adults" No
"Adaptation s and Maintenance Services" "Beneficiar ies"
"Adults" Unkown
"Adaptation s and Maintenance Services" "Delivery"
"Schedule" Yes
"Adaptation s and Maintenance Services" "Delivery"
"Schedule" No
"Adaptation s and Maintenance Services" "Delivery" "ID
Required" Yes
"Adaptation s and Maintenance Services" "Delivery" "ID
Required" No
"Complement ary Health" "Terms"
"Disclaimer " Yes
"Complement ary Health" "Terms"
"Disclaimer " No
"Complement ary Health" "Terms"
"Disclaimer " Required
"Complement ary Health" "Specialism s"
"Massage" Shiatsu
"Complement ary Health" "Specialism s"
"Massage" Amma
I was thinking of this structure -

<communitygroup >
<services type="templateN ame">
<group name="servicegr oupName1">
<service name="ServiceNa me1">ServiceVal ue1</service>
<service name="ServiceNa me2">ServiceVal ue2</service>
</group>
<group name="servicegr oupName2">
<service name="ServiceNa me3">ServiceVal ue3</service>
</group>
</services>
</communitygroup>

Thee thing I am strugling with is modelling a Schema to fit this, so far I
have -

<xs:simpleTyp e name="groupType ">
<xs:restricti on base="xs:string "/>
</xs:simpleType>
<xs:simpleTyp e name="servicesT ype">
<xs:restricti on base="xs:string ">
<xs:enumerati on value="Adaptati ons and
Maintenance Services"/>
<xs:enumerati on value="Compleme ntary Health"/>
<xs:enumerati on value="Counsell ing and
Therapy"/>
<xs:enumerati on value="Day Care Services"/>
<xs:enumerati on value="Educatio n Services"/>
<xs:enumerati on value="Equipmen t"/>
<xs:enumerati on value="Groups - Services"/>
<xs:enumerati on value="Healthca re services"/>
<xs:enumerati on value="Holidays "/>
<xs:enumerati on value="Home Care Services"/>
<xs:enumerati on value="Housing Providers"/>
<xs:enumerati on value="Meal Delivery Services"/>
<xs:enumerati on value="Mobility and Transport
Services"/>
<xs:enumerati on value="Provisio ns Delivery"/>
<xs:enumerati on value="Resident ial and Nursing
Care"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="services" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element name="group"
maxOccurs="unbo unded">
<xs:complexType >
<xs:sequence>
<xs:element name="service"
maxOccurs="unbo unded">
<xs:complexType >
<xs:attribute
type="xs:string "
name="name"
use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name"
type="groupType " use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="type"
type="servicesT ype" use="required"/>
</xs:complexType>
</xs:element>
Now the problem that I have is that I want to be able to restrict the value
of the "group" elements "name" attribute based on the value of the
"services" elements "type" attribute. For example if the services type
attribute is "A" then the group name attribute can only be "X", "Y" or "Z".
Whilst if the services type attribute is "B" then the group name attribute
can only be "M", "N" or "O".

Any help or suggestions about how to hold such data in an XML format would
be greatly appreciated...

Thanks
--
Adam Retter
Devon Portal Technician

Devon Portal Project
Devon e-Partnership
County Hall
Exeter
Devon, UK.
Jul 20 '05 #1
0 904

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

Similar topics

34
7091
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. Yensao
1
3349
by: Abhijit | last post by:
I am working in a data warehousing environment which gets sourced from Oracle ERP (AR/GL/AP). The dimensional entities associated with incoming data are GL Code (e.g. 110), Department (e.g. 1050), Core account (e.g. 301) , sub account (e.g 9). The incoming data needs to be mapped to key performance indicators (KPI) e.g. 'All Other Revenue', 'OEM Revenue' etc. The mapping is driven by GL, Dept, Core account , sub-account ranges. Example - ...
0
1375
by: AMDIRT | last post by:
I have a few questions about IssueVision (from WindowsForms) concerning its scalability and performance. Rather, if I were to implement techniques described here into another application, how would it perform, how well will it scale, and what considerations should I be take into account? First, let me say that I appreciate the work done to get this application out there for me to look over. I continually refer to it and I think I am...
19
2357
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a subset of records across all tables is often considered a separate logical system, but sometimes may be treaded ar part of the global system, and there is not simply a 1-m-m... tree among the records in a logical database. Here's an example. A...
5
2129
by: Kevin C | last post by:
I was curious to know what some developers out in the industry are doing when it comes to exposing Data access logic, specifically persistence. This is assuming that your not using an O/R framework or something that completely abstracts you from the persistence details. Are you: 1. Having simple data type interfaces and the data layer know nothing about the domain models. For example: public int SaveCustomer( string fname, string...
1
3369
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is comprised of a DataGrid may have separate permissions for adding, deleting and updating a news item. Problem Up until now, I have been implementing security directly inside the control. I will test directly against the security model to see if...
12
1492
by: Mike Gaab | last post by:
Hi, A newcomer to .Net (I've held out as long as I can.). I am using VS.Net 2003. I am writing some web apps and I am confronted with the usual issues that one faces when coming from a Windows, Apache, Mysql, PHP (WAMP) background. Is it a common practice, or even acceptable, to insert addition form tags to avoid the issues of passing form data to another webform, triggering validator controls for unrelated input controls, etc. ?
6
2051
by: Bill44077 | last post by:
Hi, I am new to the MVP pattern and one of the main reasons that we are going this route is because we are doing Scrum with 30 day sprints - so we have a continually morphing design. We are using TDD as well to improve our ability to refactor... you probably all know this approach. Although the user iterface is supposedly one of the last things that you need to do, this is a web app and we have multiple nested Repeaters on the page....
23
3137
by: tonytech08 | last post by:
What I like about the C++ object model: that the data portion of the class IS the object (dereferencing an object gets you the data of a POD object). What I don't like about the C++ object model: that most OO features are not available for class object design without loss of POD-ness. So, I'm more than leaning toward "bad" because of the limitations and
3
2453
by: Andy B | last post by:
I have about 12 services that will be used on the website I am working on. A few of them are News, Events, Venues (that work directly with Events), Mailing lists and some others. Each one of these services will have some classes and enums that are contained in a namespace of their own. When it comes to the data access (entity framework), I need to know how to design the model. Do I just put all of the database objects in a single model, or...
0
8675
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8862
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6521
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
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 we have to send another system

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.