[xliff-tools] Sun Editor with OASIS files
Rodolfo M. Raya
rodolfo at heartsome.net
Mon Sep 19 13:29:28 PDT 2005
On Mon, 2005-09-19 at 21:17 +0200, Martin Wunderlich wrote:
Hi,
> I presume I might have missed the section in the specs where it talks
> about inheritance of attributes.
Definition of "source-language" at
http://www.oasis-open.org/committees/xliff/documents/xliff-specification.htm#source-language says:
The source language can be also specified by xml:lang in each
<source> element. The values of source-language and xml:lang in
<source> can be different only in an <alt-trans> element.
In definition of <source> at
http://www.oasis-open.org/committees/xliff/documents/xliff-specification.htm#source you can read:
The optional xml:lang attribute is used to specify the content
language of the <source>; this should always match
source-language as a child of <trans-unit> but can vary as a
child of <alt-trans>.
The word inheritance is not used directly, but if you read carefully you
will realise that as the only allowed value is the one declared at
higher level, you can safely assume that the value is "inherited" if not
explicitly declared.
> It still leaves the question of how to deal with any conflicts, e.g.
> if the source-language of the file is set to one value and the
> xml:lang att in the source elements that are children of the file is
> set to a different value. Which one would take precedence?
If the language declared in <source> is different from the one declared
in <file> then you are in presence of an invalid XLIFF file. This may be
difficult to enforce with an schema and impossible with a DTD, but the
spirit of the spec is clear. An XLIFF validator should contemplate this
case. For what it's worth, the TMXValidator program at my web site
(www.maxprograms.com) checks details like this.
> Also, any ideas on what the xml:lang att in the xliff element would
> specify exactly?
The "xml:lang" attribute is defined in XML standard and adopted by
XLIFF. The specs say:
A special attribute named xml:lang MAY be inserted in documents
to specify the language used in the contents and attribute
values of any element in an XML document.
The intent declared with xml:lang is considered to apply to all
attributes and content of the element where it is specified,
unless overridden with an instance of xml:lang on another
element within that content.
This can be interpreted in several ways. My personal interpretation is
that you can declare a default language at top level, which could be
either source or target language, and then override it as needed at
<target> or <source > level. Somewhat silly, but possible. Just ignore
this attribute. I think it was included in the specs for completeness
only.
Regards,
Rodolfo
--
Rodolfo M. Raya <rodolfo at heartsome.net>
Heartsome Holdings Pte Ltd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/xliff-tools/attachments/20050919/16fc5fbb/attachment.html
More information about the xliff-tools
mailing list