On Fri, 6 Jul 2007, Derick Rethans wrote:

> On Thu, 5 Jul 2007, Kore Nordmann wrote:
> 
> > "The RELAX NG specifications have been developed within OASIS by the
> > RELAX NG Technical Committeee. RELAX NG is being developed into an
> > International Standard (ISO/IEC 19757-2) by ISO/IEC JTC1/SC34/WG1; it is
> > currently at the final stage of standardization."

I've done a bit of research, and we can't use the "simple" version here, 
as libxml can not use that for validation. The leaves us with either 
XML Schema or RelaxNG (normal). I tried trang on our linguist files, and 
the results for both schemas can be found as attachments. (Also the 
corresponding .rnc).

XML Schema is quite harder to read, even more if things get more 
complex. I would therefore suggest to use RelaxNG as our schema 
definition language.

Let's vote on this: +1 for RelaxNG.


regards,
Derick
<?xml version="1.0" encoding="UTF-8"?>
<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0"; datatypeLibrary="">
  <start>
    <element name="TS">
      <oneOrMore>
        <element name="context">
          <element name="name">
            <text/>
          </element>
          <oneOrMore>
            <element name="message">
              <element name="source">
                <text/>
              </element>
              <element name="translation">
                <optional>
                  <attribute name="type">
                    <choice>
                      <value type="string">unfinished</value>
                      <value type="string">obsolete</value>
                    </choice>
                  </attribute>
                </optional>
                <text/>
              </element>
            </element>
          </oneOrMore>
        </element>
      </oneOrMore>
    </element>
  </start>
</grammar>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified">
  <xs:element name="TS">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="context"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="context">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="name"/>
        <xs:element maxOccurs="unbounded" ref="message"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="name" type="xs:string"/>
  <xs:element name="message">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="source"/>
        <xs:element ref="translation"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="source" type="xs:string"/>
  <xs:element name="translation">
    <xs:complexType mixed="true">
      <xs:attribute name="type">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="unfinished"/>
            <xs:enumeration value="obsolete"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>
default namespace = ""

start =
  element TS {
    element context {
      element name { text },
      element message {
        element source { text },
        element translation {
          attribute type { string "unfinished" | string "obsolete" }?,
          text
        }
      }+
    }+
  }
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to