[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML Schema and Chessboards


chess position xml
> Very possibly I've got my apples and oranges (and my 
> metaphores) mixed up
> here, but I don't really want to model the rules of the 
> board, just these
> sort of obvious impossibilities:
> 
> - not allowing two allied bishops on the same colour (oh, HOW?)

I wouldn't try to model that one, because a valid chess position can have
two allied bishops on the same colour square (as a result of pawn
promotion). In fact, a valid position can have nine allied bishops on the
same colour square...
> 
> - making sure every other square on the board is going to be black
>   (this i'm fighting with, and giving up)

The colour of the squares carries no information, so why are you trying to
represent it?

> 
> So there is either the possibility of forcing the whole board 
> to be present
> in the document or the more sensible method of just 
> presenting the pieces
> with their coordinates.

There are many different representations possible, and to choose between
them you will have to decide what you are trying to optimize. You may want
multiple representations for different parts of your application, with
transformations to get from one to another.

Whatever representation you choose, validating whether an input document
represents a legal position is almost certainly beyond the capability of XML
Schema.

Michael Kay
http://www.saxonica.com/ 




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.