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

RE: XML Schema and Chessboards


chessboards
Most of your constraints are not regular structural constraints. XML
Schemas  does not operate at that kind of level well.

The Schematron schema language layers on top of XML Schemas. It can let
you report such things as

 * the king is in check
 * the king has no position to go to where he is not also in check
 * after a move, a rook must be either in the same place, or taken,
or in one of the 2+1 jump positions, or swapped with the king

plus the constraints you mention
 * not allowing two allied bishops on the same colour (oh, HOW?)
 * Only exactly one King per side (done)
 * Maximum number of piece types, alowing for promotion (yep)
 * pawns dont get to go to home (done)

Cheers
Rick Jelliffe


Jon IV Thompson Coon said:
>> You need to be a lot more specific about what information you want to
>> represent. The state of a game (where the pieces are)? The history of a
>> game (how the pieces got there)? An analysis of the game?
>
> I was being vague, because I was backhandedly asking permission to present
> my puny problem first...
>
> 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?)
> - Only exactly one King per side (done)
> - Maximum number of piece types, alowing for promotion (yep)
> - pawns dont get to go to home (done)
>
> Questions like "how, and can, a Knight move here" are not an issue.
>
> On the other hand these are:
>
> - making sure every other square on the board is going to be black
>   (this i'm fighting with, and giving up)
> - pieces don't occupy the same square (uniqueness with coordinates?)
>
>
> The board representation thingie is annoying me. If I make sure that every
> square is represented in the document and within a square there is at
> maximum one piece, everything else becomes a hazzle. How do I check for
> "one
> king" or "less than nine pawns", this is what i can't get my head around.
>
> and of course checking for the sameness of bishops
>
> 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. Unfortunately I'm required to do it the first way
> unless i can somehow mathematicise within the schema to force the b/w grid
> unto the creator of the xml document?
>
>
> Jon Thompson Coon
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
>
>


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.