XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 6th, 2004, 12:00 AM
theaks theaks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 theaks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XML Schema problem

A while ago for a Uni subject we developed some web apps using XML with DTDs. I've recently started working on a project where I want to use similar technologies but I've decided to go with Schemas instead.

I'm very happy with the power the schemas give me but I've run into a problem I don't know how to get around. I think the best way is an example.

An XML document for describing junior baseball games is being created. Everyone knows games go for 9 innings, but if the score is tied then a 10th inning will be played and so on until there is a winner. The innings are described as

<xsd:complexType name="inning">
<xsd:sequence>
<xsd:element name="number" type="xsdositiveInteger"/>
<xsd:element name="away" type="xsd:nonNegativeInteger"/>
<xsd:element name="home" type="xsd:nonNegativeInteger"/>
</xsd:sequence>
</xsd:complexType>

So they look like this:

<inning>
<number>1</number>
<away>0</away>
<home>2</home>
</inning>
<inning>
<number>2</number>
<away>1</away>
<home>1</home>
</inning>

and so on.

Currently i'm just allowing minOccurs="9" MaxOccurs="unbounded" amount of innings.

What i would much prefer would to enforce that there was 9 innings (numbered one to nine) and as many extra that are needed, as long as they are numbered in sequencal order.

Any help would be great, i'd be happy to adjust the way the data is structed now as i'm still in an early phase.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XML Schema problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT