XTCE 1.2 RTF Avatar
  1. OMG Issue

XTCE12 — Add regex to enforced syntax of NameReferences

  • Key: XTCE12-11
  • Legacy Issue Number: 19446
  • Status: closed  
  • Source: NASA ( Mr. James Kevin Rice)
  • Summary:

    NameReferences which are "text pointers" in XTCE are currently an open string type, even though the form is "path-like" (e.g. sat/power/battery[0].voltage). There are a variety of forms of it and different types (regular namereferences and parameter instance refs). The syntax of these could be enforced with a regular expression. Below is an example that can used as basis for in the spec.

    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="test">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="path" maxOccurs="unbounded">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:pattern value="/?(([a-zA-Z0-9_\-]|\.|\.\.)/)([a-zA-Z0-9_\-]([[0-9]])?)([\.][a-zA-Z0-9_\-]([[0-9]+])?)"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    — EXAMPLES

    <test xsi:noNamespaceSchemaLocation="path.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <path>foo</path>
    <path>foo[9].bar[0].baz[0]</path>
    <path>foo[0999]</path>
    <path>/foo/bar</path>
    <path>/foo/bar/baz</path>
    <path>/oo/bar/baz.bif</path>
    <path>/foo/bar[99].bif</path>
    <path>foo/bar[99].bif</path>
    <path>../././bar[99].bif</path>
    </test>

  • Reported: XTCE 1.1 — Wed, 4 Jun 2014 04:00 GMT
  • Disposition: Resolved — XTCE 1.2
  • Disposition Summary:

    Propose to accept the updated regular expression

    The issue description contains an updated regular expression that passes the tests needed. Propose to accept this restriction update in the NameReferenceType.

    Replace the restriction in NameReferenceType:
    <simpleType name="NameReferenceType">
    ...
    <restriction base="string"/>
    </simpleType>

    with the new restriction:
    <restriction base="string">
    <pattern value="/?(([a-zA-Z0-9_\-]|\.|\.\.)/)([a-zA-Z0-9_\-]([[0-9]])?)([\.][a-zA-Z0-9_\-]([[0-9]+])?)"/>
    </restriction>

  • Updated: Tue, 10 Jul 2018 14:22 GMT