[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Implementer FAQ Entry / Suggestion
Hi all, Now on to something for a potential Implementer FAQ entry: The XLIFF 1.2 specification has a number of elements (<header>, <trans-unit>, <alt-trans>, <bin-unit>, ) that contains the statement "While for backward compatibility reasons no order is enforced for the elements before the non-XLIFF elements, the recommended order is the one in which they are listed here." To ensure that this recommendation is followed, implementers may validate their instances against a modified schema that enforces the order of child elements. For example, the <header> element has the following schema definition: <xsd:element name="header"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="skl" type="xlf:ElemType_ExternalReference"/> <xsd:element minOccurs="0" ref="xlf:phase-group"/> <xsd:choice maxOccurs="unbounded" minOccurs="0"> <xsd:element name="glossary" type="xlf:ElemType_ExternalReference"/> <xsd:element name="reference" type="xlf:ElemType_ExternalReference"/> <xsd:element ref="xlf:count-group"/> <xsd:element ref="xlf:note"/> <xsd:element ref="xlf:tool"/> </xsd:choice> <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> </xsd:sequence> </xsd:complexType> </xsd:element> To enforce this recommendation in your instance document, the definition can be changed by removing the enclosing xsd:choice element and adding the appropriate minOccurs and maxOccurs attributes to the children of the original xsd:choice element, as shown below: <xsd:element name="header"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="skl" type="xlf:ElemType_ExternalReference"/> <xsd:element minOccurs="0" ref="xlf:phase-group"/> <xsd:element name="glossary" type="xlf:ElemType_ExternalReference" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="reference" type="xlf:ElemType_ExternalReference" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="xlf:count-group" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="xlf:note" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="xlf:tool" maxOccurs="unbounded" minOccurs="0"/> <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> </xsd:sequence> </xsd:complexType> </xsd:element> This could perhaps be included in a later "strict" schema that includes all errata items... cheers, asgeir -- Asgeir Frimannsson PhD Candidate School of Software Engineering and Data Communications Queensland University of Technology 126 Margaret Street, Level 3 Brisbane QLD 4001, Australia Phone: (+61) 7 3138 9332 Mob: (+61) 405 412 696 Email: asgeirf@gmail.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]