Re: XLink 1.1, let's get the party started

Norman Walsh scripsit:

> I believe anyElem has to allow simple|extended, otherwise after you
> get into the "anyElem" branch, you can never get back out.

In fact we don't want to be able to get out, because XLink 1.1 doesn't
support links inside links.  But there are other problems: in particular,
currently I don't allow the root to be a link.  Here's a revised
definition clearly separating "foreignElem" and "anyElem".

(Editorial note: grep your draft for "Xlink-specified relationship";
there are still some of those left, like the one in the third graf of
5.1.1, which should say that a resource element with other XLink elements
inside it is not conformant.)

namespace xlink = "http://www.w3.org/1999/xlink"

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

simple = element * {
		(simple.type | href.att | (simple.type, href.att)),
		foreignAttr*, role.att?, arcrole.att?, title.att?,
		show.att?, actuate.att?,
		(foreignElem | text)*
		}

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

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

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

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

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

start = anyElem

anyElem = simple | extended | element * { foreignAttr*, (anyElem | text)* }

foreignElem = element * {foreignAttr*, (foreignElem | text)*}

foreignAttr = attribute * - xlink:*  {text}

-- 
Newbies always ask:                             John Cowan
  "Elements or attributes?                      http://www.ccil.org/~cowan
Which will serve me best?"                      http://www.reutershealth.com
  Those who know roar like lions;               jcowan@reutershealth.com
  Wise hackers smile like tigers.                   --a tanka, or extended haiku

Received on Wednesday, 13 April 2005 20:52:40 UTC