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

Samuel Spencer theodore.therone at gmail.com
Tue Dec 9 17:49:31 EST 2014


In cases where an XML:lang is optional to determine the 'implied language"
it cascades up the XML tree until it finds a valid ancestor element. Its
actually defined in the reverse to that, "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." - -
http://docs.oasis-open.org/dita/v1.1/OS/archspec/xmllang.html

I believe that if an XML:lang value is expected, and no valid xml:lang
attribute is set on a parent is set a default value is assumed, and I
believe this is 'en:us', so in your example those strings would be "America
English".

Quite a while ago Olof and I put together some XPath/XSLT and XQuery gists
that address this: http://bit.ly/Nx5oDb



--- Specificity is the soul of all good communication ---
--- When the game is over, the king and the pawn go into the same box ---
Find out more about me: http://about.me/legostormtroopr

On 10 December 2014 at 09:16, 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.icpsr.umich.edu/pipermail/ddi-users/attachments/20141210/84294367/attachment.html 


More information about the DDI-users mailing list