[DDI-users] DDI 3.2: optional xml:lang attribute in StringType

Wendy Thomas wlt at umn.edu
Tue Dec 9 21:10:39 EST 2014


Jani,

InternationalString contains only 1..n String elements. Each string element
has the following set of attributes: xml:lang, isTranslated,
isTranslatable, translationSourceLanguage, and translationDate.

We made a large number of objects (elements and attributes) optional to
support creating metadata at varying points in the production process. This
is one of those cases. All Maintainable objects have an optional xml:lang
which can be inherited by the content. This is common in cases where all of
the content is of a single language. Clearly multiple strings would be
confusing without xml:lang attributes and those using multiple languages
should make use of the available metadata objects to clarify the situation.
DDIProfile can be used by organizations to tighten up requirements for
various production levels such as publication.

The XML structure is given below.

Wendy

<xs:complexType name="InternationalStringType">
<xs:annotation>
<xs:documentation>Packaging structure for multiple language versions of the
same string content. Where an element of this type is repeatable, the
expectation is that each repetition contains different content, each of
which can be expressed in multiple languages. The language designation goes
on the individual String.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="String" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>A non-formatted string of text with an attribute that
designates the language of the text. Repeat this object to express the same
content in another language.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="String" type="StringType">
<xs:annotation>
<xs:documentation>Allows for non-formatted strings that may be translations
from other languages, or that may be translatable into other languages.
Only one string per language/location type is allowed.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="StringType">
<xs:annotation>
<xs:documentation>Allows for non-formatted strings that may be translations
from other languages, or that may be translatable into other languages.
Only one string per language/location type is allowed. String contains the
following attributes, xml:lang to designate the language, isTranslated with
a default value of false to designate if an object is a translation of
another language, isTranslatable with a default value of true to designate
if the content can be translated, translationSourceLanguage to indicate the
source languages used in creating this translation, and
translationDate.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang">
<xs:annotation>
<xs:documentation>Indicates the language of content. Note that xml:lang
allows for a simple 2 or 3 character language code or a language code
extended by a country code , for example en-au for English as used in
Australia.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="isTranslated" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>Indicates whether content is a translation (true) or an
original (false).</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="isTranslatable" type="xs:boolean" default="true">
<xs:annotation>
<xs:documentation>Indicates whether content is translatable (true) or not
(false). An example of something that is not translatable would be a
MNEMONIC of an object or a number.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="translationSourceLanguage" type="LanguageList"
use="optional">
<xs:annotation>
<xs:documentation>List the language or language codes in a space delimited
array. The language original may or may not be provided in this bundle of
language specific strings.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="translationDate" type="xs:date" use="optional">
<xs:annotation>
<xs:documentation>The date the content was translated. Provision of
translation date allows user to verify if translation was available during
data collection or other time linked activity.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>


On Tue, Dec 9, 2014 at 4:16 PM, Jani Hautamäki <Jani.Hautamaki at staff.uta.fi>
wrote:

>  In DDI-Lifecycle 3.2 all elements which are instances of
>
> {ddi:reusable:3_2}InternationalStringType
>
> must have one or more <r:String> elements.
> The field-level specification for InternationalStringType
>
>
> http://www.ddialliance.org/Specification/DDI-Lifecycle/3.2/XMLSchema/FieldLevelDocumentation/schemas/reusable_xsd/complexTypes/StringType.html
>
> states that
>
> "Allows for non-formatted strings that may be translations
> from other languages, or that may be translatable into
> other languages. Only one string per language/location type
> is allowed. String contains the following attributes,
> xml:lang to designate the language, [...]"
>
> However, the XML Schema for DDI-Lifecycle 3.2 allows
> the elements of r:InternationalStringType to have multiple <r:String>
> children without any xml:lang attributes designating language/country/etc.
>
> For instance, the following XML document is VALID
> with respect to DDI-Lifecycle 3.2 XML Schema,
>
> ---8<---8<---8<---
> <?xml version="1.0" encoding="utf-8"?>
> <ddi:DDIInstance
>     xmlns:ddi="ddi:instance:3_2"
>     xmlns:r="ddi:reusable:3_2"
>     xmlns:s="ddi:studyunit:3_2"
>     >
>
>   <r:Agency>acme.org</r:Agency>
>   <r:ID>ddi_instance</r:ID>
>   <r:Version>1</r:Version>
>   <r:URN>urn:ddi:acme.org:another_ddi_instance:1</r:URN>
>
>   <s:StudyUnit>
>     <r:Agency>acme.org</r:Agency>
>     <r:ID>study_unit</r:ID>
>     <r:Version>1</r:Version>
>
>     <r:Citation>
>       <r:Title>
>         <!-- Use of @xml:lang is optional -->
>         <r:String>voisi olla suomeksi</r:String>
>         <r:String>could be in english too</r:String>
>       </r:Title>
>     </r:Citation>
>
>   </s:StudyUnit>
> </ddi:DDIInstance>
> ---8<---8<---8<---
>
> In the document above, the <r:Title> has two <r:String> elements,
> both in different language, but without any xml:lang attributes,
> sinsce the XML Schema does not require it.
>
> My question is then:
>
> Is it a bug in the XML Schema of r:InternationalStringType
> that it allows instances of <r:String> without xml:lang attribute?
>
> If not, which language/country should be assumed for such an element?
> Futhermore, when there are two or more <r:String> elements
> without the xml:lang attribute, which one of them should be used?
>
> It is possible to force xml:lang attribute for r:StringType.
> However, in my opinion, it might be more desirable to simply
>
> use attribute "lang"  instead "xml:lang" for that purpose...
>
>
> _______________________________________________
> DDI-users mailing list
> DDI-users at icpsr.umich.edu
> http://lists.icpsr.umich.edu/mailman/listinfo/ddi-users
>
>


-- 
Wendy L. Thomas                              Phone: +1 612.624.4389
Data Access Core Director                 Fax:   +1 612.626.8375
Minnesota Population Center             Email: wlt at umn.edu
University of Minnesota
50 Willey Hall
225 19th Avenue South
Minneapolis, MN 55455
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.icpsr.umich.edu/pipermail/ddi-users/attachments/20141209/a336a4d3/attachment-0001.html 


More information about the DDI-users mailing list