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

Re: Announce: XML Schema,


xlink xml schema
Thomas B. Passin scripsit:

> You also do not have a hope of getting the WXS schema right without a tool
> to help, at least not for one with any complexity.  I'm not sure if the same
> is true for RelaxNG.  John?  What do you say?

Well, what counts as a tool?  I certainly run every RNG schema that I
write through Jing in its schema-checking mode (just don't specify any
document to validate), and generally find a typo or two and sometimes
a violation of an RNG rule, generally of the paper-bag variety.

But I write them all in a plain text editor with no special support.
If I were writing XML-syntax schemas, I would certainly use
Henry Thompson's wonderful XED editor, which is basically a plain text
editor that forces the document to be well-formed.

OTOH, when developing my complete XLink schema (which validates a
document if and only if it conforms to XLink) I had to do lots of
Jing passes until I got something that did what I wanted and
was semantically allowed.  But XLink is a very unusual schema
with extensive use of wildcards.

I'll publish it here just for s**ts and giggles.  There may be
undetected semantic problems, use at your own risk, I claim no
copyright.

=====cut here=====

# RELAX NG schema for W3C XLink

datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
namespace xlink = "http://www.w3.org/1999/xlink"

href = attribute xlink:href {xsd:anyURI}
role = attribute xlink:role {xsd:anyURI}
arcrole = attribute xlink:arcrole {xsd:anyURI}
title.att = attribute xlink:title {text}
show = attribute xlink:show {"new"|"replace"|"embed"|"other"|"none"}
actuate = attribute xlink:actuate {"onLoad"|"onRequest"|"other"|"none"}
label = attribute xlink:label {xsd:NMTOKEN}
from = attribute xlink:from {xsd:NMTOKEN}
to = attribute xlink:to {xsd:NMTOKEN}

simple = element * {
		attribute xlink:type {"simple"}, anyAttr*,
		href?, role?, arcrole?, title.att?, show?, actuate?,
		(anyElem | text)*
		}

extended = element * {
		attribute xlink:type {"extended"}, anyAttr*,
		role?, title.att?,
		(title | resource | locator | arc | anyElem | text)*
		}

title = element * {
		attribute xlink:type {"title"}, anyAttr*,
		(anyElem | text)*
		}

resource = element * {
		attribute xlink:type {"resource"}, anyAttr*,
		role?, title.att?, label?,
		(anyElem | text)*
		}

locator = element * {
		attribute xlink:type {"locator"}, anyAttr*,
		href, role?, title.att?, label?,
		(title | anyElem | text)*
		}

arc = element * {
		attribute xlink:type {"arc"}, anyAttr*,
		arcrole?, title.att?, show?, actuate?, from?, to?,
		(title | anyElem | text)*
		}

start = element * { anyAttr*, (simple | extended | anyElem)* }

anyElem = element * {anyAttr*, (anyElem | text)*}

anyAttr = attribute * - xlink:*  {text}

=====cut here=====

-- 
John Cowan <jcowan@r...>     http://www.reutershealth.com
I amar prestar aen, han mathon ne nen,    http://www.ccil.org/~cowan
han mathon ne chae, a han noston ne 'wilith.  --Galadriel, _LOTR:FOTR_

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.