← Prev in month ← Prev in thread

RE: [xliff] Working Draft - Extension of values

From
Lieske, Christian <>
Date
2002-07-23T09:53:03+00:00
ID
333D9700B499084C9DF804896DDA7178837690@dewdfx14
Thread
RE: [xliff] Working Draft - Extension of values
Hi Yves,

You asked for ideas related to the extension of values. Here's
one approach I have seen ...

Best,
Christian
---

Scenario:

We have an element 'y'. For element 'y', we want to say that its
possible contents may either be drawn

- from a list of codes for English
- from a list of codes for French
- from a user-defined list of codes

Implementation approach:

1. We define three schemas: one for the English codes, one for the French
   ones, and one for user-defined ones (see A., B., C. below). The schemas
   define new types.
2. We define a schema for element 'y'. The type for 'y' is defined as a union
   of the new types we have defined (see D. below).
3. A user who wants to supply own codes only has to change the schema for
   user-defined codes (see E. below).

A. schema for codes for English

<xsd:schema targetNamespace="http://www.x.net" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.x.net">
	<xsd:simpleType name="yENcodeType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="16">
				<xsd:annotation>
					<xsd:documentation>book, books</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="17">
				<xsd:annotation>
					<xsd:documentation>box, boxes</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="310">
				<xsd:annotation>
					<xsd:documentation>much, how much</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>

B. schema for codes for French

<xsd:schema targetNamespace="http://www.olif.net" xmlns="http://www.olif.net" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:simpleType name="inflectionFRcodeType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="114">
				<xsd:annotation>
					<xsd:documentation>uninflected plural only, les archives; sing and plural same, la/les noix</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="119">
				<xsd:annotation>
					<xsd:documentation>singular and plural la porte /  les portes)</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="201">
				<xsd:annotation>
					<xsd:documentation>quel</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>

C. schema for user-defined codes

<xsd:schema targetNamespace="http://www.x.net" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.x.net">

	<xsd:simpleType name="yUEType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="user extensions">
				<xsd:annotation>
					<xsd:documentation>this type can be extended by adding enumeration values here.</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>

D. schema for element 'y'

<xsd:schema targetNamespace="http://www.x.net" xmlns="http://www.x.net" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:include schemaLocation="yENcode.xsd"/>
	<xsd:include schemaLocation="yFRcode.xsd"/>
	<xsd:include schemaLocation="yUEType.xsd"/>

	<xsd:simpleType name="yType">
		<xsd:union memberTypes="yENcodeType yFRcodeType yUEType"/>
	</xsd:simpleType>

	<xsd:element name="y" type="yType">
		<xsd:annotation>
			<xsd:documentation>The y element holds data about ...</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

</xsd:schema>

E. modified schema for user-defined codes

<xsd:schema targetNamespace="http://www.x.net" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.x.net">

	<xsd:simpleType name="yUEType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="ue1">
				<xsd:annotation>
					<xsd:documentation>ue1 means 'a'</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="ue2">
				<xsd:annotation>
					<xsd:documentation>ue2 means 'b'</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>

-----Original Message-----
From: Yves Savourel [mailto:]
Sent: Freitag, 12. Juli 2002 21:50
To: XLIFF list
Subject: [xliff] Working Draft


Hi everyone,

Here is an updated version of the working draft for 1.1. The zip file
includes the schema for the core and the values.

I didn't include the proposal for <reformat> nor <tool> in it yet.

I'm still looking into how to allow extending attribute values. I suppose
you can define your own list of types and import the pre-defined one, but
that is akward for validation. It would be nice to fine a way to have to
change only imported files, so the reference to the main XSDs would remain
the same regardless whether or not you have your own extension.
I hope some of you have ideas for this, because I can see I'm running out...

Have a great week-end
-yves
← Prev in month ← Prev in thread