OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xliff message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: namespace versioning


All,

As it turns out, the policy of changing the namespace every version is
complicating the XSLTs to process XLIFF documents. I realize that the TC is
following OASIS recommendation, but I feel that the recommendation, while
having some merit, may be causing more problems than it is fixing.

I use an XSLT to merge an XLIFF document with its skeleton. I need to have
separate XSLTs for each version. Since XLIFF 1.0 uses a DTD rather than an
XML namespace, the XSLT for 1.0 and 1.x differ in that the 1.x namespaces
require a prefix. The only difference between 1.1 and 1.2 is the namespace.

Examples,

Merge XLIFF 1.0

<xsl:template match="/">
	<xsl:for-each select="xliff/file">
		<xsl:variable name="skeleton"
select="concat($path,header/skl/external-file/@href)"/>
		<xsl:apply-templates select="document($skeleton, /)/*"> 
			<xsl:with-param name="xliff-context" select="body"/>
		</xsl:apply-templates>
	</xsl:for-each>
</xsl:template>

Merge XLIFF 1.1

... xmlns:xlf="urn:oasis:names:tc:xliff:document:1.1" ...

<xsl:template match="/">
	<xsl:for-each select="xlf:xliff/xlf:file">
		<xsl:variable name="skeleton"
select="concat($path,xlf:header/xlf:skl/xlf:external-file/@href)"/>
		<xsl:apply-templates select="document($skeleton, /)/*"> 
			<xsl:with-param name="xliff-context"
select="xlf:body"/>
		</xsl:apply-templates>
	</xsl:for-each>
</xsl:template>

Merge XLIFF 1.2

... xmlns:xlf="urn:oasis:names:tc:xliff:document:1.2" ...

<xsl:template match="/">
	<xsl:for-each select="xlf:xliff/xlf:file">
		<xsl:variable name="skeleton"
select="concat($path,xlf:header/xlf:skl/xlf:external-file/@href)"/>
		<xsl:apply-templates select="document($skeleton, /)/*"> 
			<xsl:with-param name="xliff-context"
select="xlf:body"/>
		</xsl:apply-templates>
	</xsl:for-each>
</xsl:template>


Note that XLIFF 1.0 does not use the xlf: prefix because it uses DOCTYPE.
Note that XLIFF 1.1 and 1.2 are identical, just the xmlns:xlf is different.

I'm not sure what we can do, if anything, but I would be interested in other
people's comments/suggestions and whether they have also had this problem.

BTW, I use XLIFF 1.1 for the skeleton format.

Regards,
 
Doug Domeny
Software Analyst
 
Ektron, Inc.
+1 603 594-0249 x212
http://www.ektron.com
 
-----Original Message-----
From: Marc [mailto:wax@xs4all.nl] 
Sent: Monday, February 13, 2006 1:02 PM
To: xliff-comment@lists.oasis-open.org
Subject: Re: [xliff-comment] Public Comment

Hi,

Although i'm not fully informed on the position that the TC takes
regarding namespaces I think that tools that work with XML that adheres to
XML Namespaces should never rely on prefixes and always use the fully
qualified names rather then local element names. Given that the XLIFF spec
shows xmlns="urn:oasis:names:tc:xliff:document:1.1" in the examples i
assume the spec adheres to the XML namespaces which implies that it is
perfectly legal to use prefixed element names.

One other thing I noticed though, is that the namespace changes with each
version which is different from, for example, the way the XSLT spec
handles it. XSLT does not change the namespace URI but relies on the a
version attribute to distinguish 1.0, 1.1, 2.0 XSLT stylesheets. I can
imagine that the namespace URI changes could cause more problems with
tools than the fact that prefixes can be used. I remember such problems
from the early days of XSLT when the URI changed several times.

XML.com had an article on versioning XML vocabularies which might be of
interest: http://www.xml.com/pub/a/2003/12/03/versioning.html

> When a new version of a language is required, and it is backwards
> compatible with the older language, then the author must make a
> decision about the namespace name for names in the new language.
> There are two choices: create a new namespace name or reuse the
> existing namespace name. We argue that reusing is more efficient,
> and we will explore the problems with option #1 in the "new
> namespace" section.

There's also this document on the use of `sane` namespaces which I found
quite interesting and could help to establish best practices for the use
of XML namespaces in a spec like XLIFF. See:
http://lists.xml.org/archives/xml-dev/200204/msg00170.html


Cheers,
--Marc

comment-form@oasis-open.org wrote:
> Comment from: rodolfo@heartsome.net
>
> Name: Rodolfo M. Raya
> Title: Director of Product Development
> Organization: Heartsome Holdings Pte Ltd
> Regarding Specification: XLIFF 1.1 / XLIFF 1.2
>
>
> Today I received a file with this format:
>
> <?xml version="1.0" encoding="utf-8"?>
> <xlf:xliff version="1.1"
> xmlns:xlf="urn:oasis:names:tc:xliff:document:1.1">
>   <xlf:file datatype="xml" original="source.xml" source-language="en">
>     <xlf:body>
>           <xlf:trans-unit id="1" datatype="xml">
>             <xlf:source>hello</xlf:source>
>           </xlf:trans-unit>
>     </xlf:body>
>   </xlf:file>
> </xlf:xliff>
>
>
> By using a prefix in namespace declaration the names of the XLIFF elements
> are altered. This is a complication for tools that support XLIFF files and
> relay on standard element names instead of fully qualified names.
>
> XLIFF specs do not mention the use of prefixes for the XLIFF namespace.
> Which is the position of the XLIFF TC regarding this use of the XLIFF
> namespace?
>
> Could an official recommendation or a best practise statement be added to
> the XLIFF 1.2 specs?
>
> Best regards,
> Rodolfo M. Raya
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xliff-comment-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: xliff-comment-help@lists.oasis-open.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: xliff-comment-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: xliff-comment-help@lists.oasis-open.org





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]