|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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="xsd ositiveInteger"/><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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XML Schema problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|