XForms-20.rnc

From W3C XForms Group Wiki (Public)
Jump to: navigation, search

xforms-20.rnc

# -*- rnc -*-
# Namespaced XForms 2.0 schema in RELAX NG
# 
#    Copyright (C) 2009-2011 W3C (R); (MIT, ERCIM, Keio), All Rights Reserved.
# 
# 
#    Permission to use, copy, modify and distribute this RELAX NG schema
#    for XForms 2.0 and its accompanying documentation for any purpose and
#    without fee is hereby granted in perpetuity, provided that the above
#    copyright notice and this paragraph appear in all copies. The copyright
#    holders make no representation about the suitability of this RELAX NG
#    schema for any purpose.
# 
#    It is provided "as is" without expressed or implied warranty.
#    For details, please refer to the W3C software license at:
# 
# http://www.w3.org/Consortium/Legal/copyright-software

namespace xf = "http://www.w3.org/2002/xforms"

include "xforms-nons-20.rnc" inherit = xf {
  xforms.anyForeignElement = element (* - xf:*) {
    (attribute * { text }
     | text
     | xforms.anyForeignElement)*
  }
}

# repeat attributes in xf namespace
xforms.repeat-nodeset.attr = attribute xf:repeat-nodeset { XPathExpression } # deprecated
xforms.repeat-ref.attr = attribute xf:repeat-ref { XPathExpression }
xforms.repeat-indexref.attr = attribute xf:repeat-indexref { XPathExpression }
xforms.repeat-bind.attr = attribute xf:repeat-bind  { xsd:IDREF }
xforms.repeat-model.attr = attribute xf:repeat-mode { xsd:IDREF }
xforms.repeat-startindex.attr = attribute xf:repeat-startindex { xsd:positiveInteger }
xforms.repeat-number.attr = attribute xf:repeat-number { xsd:nonNegativeInteger }
xforms.repeat-various.attrs = xforms.repeat-ref.attr?,
   xforms.repeat-nodeset.attr?, xforms.repeat-bind.attr?,
   xforms.repeat-model.attr?, xforms.repeat-startindex.attr?, xforms.repeat-number.attr?,
   xforms.repeat-indexref?

# xforms elements
xforms.group.attrib &= xforms.repeat-various.attrs

# bind and ref attributes in xf namespace
xforms.bind.attr = attribute xf:bind { xsd:IDRef }
xforms.ref.attr = attribute xf:ref { XPathExpression }