# RELAX NG Schema for OpenMath 2 default namespace om = "http://www.openmath.org/OpenMath" namespace xlink = "http://www.w3.org/1999/xlink" # OM2: allow OMR omel = OMS | OMV | OMI | OMB | OMSTR | OMF | OMA | OMBIND | OME | OMATTR |OMR # things which can be variables omvar = OMV | attvar attvar = element OMATTR { common.attributes,(OMATP , (OMV | attvar))} #OM2: common attributes cdbase = attribute cdbase { xsd:anyURI}? common.attributes = (attribute id { xsd:ID })? compound.attributes = common.attributes,cdbase # symbol OMS = element OMS { common.attributes, attlist.OMS} attlist.OMS = attribute name { xsd:NCName}, attribute cd { xsd:NCName}, cdbase # variable OMV = element OMV { common.attributes, attlist.OMV,omel?} attlist.OMV = attribute name { xsd:NCName} # integer OMI = element OMI { common.attributes, xsd:string {pattern = "\s*(-\s?)?[0-9]+(\s[0-9]+)*\s*"}} # byte array OMB = element OMB { common.attributes, xsd:base64Binary } # string OMSTR = element OMSTR { common.attributes, text } # floating point OMF = element OMF { common.attributes, attlist.OMF} attlist.OMF = attribute dec { xsd:string {pattern = "(-?)([0-9]+)?(\.[0-9]+)?(e([+\-]?)[0-9]+)?"}}| attribute hex { xsd:string {pattern = "[0-9A-F]+"}} # apply constructor OMA = element OMA { compound.attributes, omel+ } # binding constructor and variable OMBIND = element OMBIND { compound.attributes, omel, OMBVAR, omel } OMBVAR = element OMBVAR { common.attributes, omvar+ } # error OME = element OME { common.attributes, OMS, omel* } # attribution constructor and attribute pair constructor OMATTR = element OMATTR { compound.attributes, OMATP, omel } # OM2: allow OMFOREIGN OMATP = element OMATP { compound.attributes, (OMS, (omel | OMFOREIGN) )+ } # OM2: OMFOREIGN OMFOREIGN = element OMFOREIGN { compound.attributes, (omel|notom)* } # Any elements not in the om namespace (valid om is allowed as a descendant) notom = (element * - om:* {attribute * { text }*,(omel|notom)*} | text) # OM object constructor OMOBJ = element OMOBJ { compound.attributes, omel } attlist.OMOBJ = attribute version { "1.0" | "1.2" | "2.0" } # OM2: OMR OMR = element OMR { common.attributes, attlist.OMR } attlist.OMR = attribute xlink:href { text }, attribute xlink:type {"simple"}, attribute xlink:show {"embed"} start = OMOBJ