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


Help: OASIS Mailing Lists Help | MarkMail Help

xliff-comment message

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

Subject: [xliff-comment] Including XHTML with XLIFF

I would like to include XHTML tags in the XLIFF document and still be able
to validate and transform the XLIFF document. I don't want to require the
translator to include the xhtml: (or html:) namespace when entering XHTML
tags. It seems more natural to have to specify XLIFF tags (like <ph>) with
the xlf: namespace rather than the more familiar HTML tags.

Therefore I believe I need to make XHTML the default namespace and
explicitly set the XLIFF namespace.

Example XLIFF document,

<?xml version="1.0" encoding="UTF-8"?>
<xlf:xliff version="1.1" xmlns:xlf="urn:oasis:names:tc:xliff:document:1.1"
xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.1 xliff.xsd"
	<xlf:file original="" source-language="EN" target-language="ES"
			<xlf:trans-unit id="hw" datatype="html">
					<i class="greeting">Hello</i> <xlf:ph id="w">World</xlf:ph>
					<i class="greeting">Hola</i> <xlf:ph id="w">Mundo</xlf:ph>

This document validates without a problem.

The problem comes with the XSLT. The namespace attributes are in the output.

Example XSLT, (note that the XLIFF tags MUST be prefixed with "xlf:")
This XSLT copies the contents for the <target> tag, which may include HTML
tags and converts <xlf:ph> to a hyperlink (<a href>).

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

	<xsl:template match="/">
			<xsl:apply-templates select="//xlf:target"/>

	<xsl:template match="xlf:*">
		<xsl:apply-templates />

	<xsl:template match="xlf:ph">
		<a href="www.xliff.org"><xsl:apply-templates /></a>

	<xsl:template match="*">
			<xsl:apply-templates select="@*" />
			<xsl:apply-templates />

	<xsl:template match="@*">
		<xsl:copy-of select="."/>


Example results,

<i class="greeting" xmlns:xlf="urn:oasis:names:tc:xliff:document:1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns="xhtml">Hola</i>
<a href="www.xliff.org"

As you can see, the results have 'xmlns:xlf', 'xmlns:xsi', and 'xmlns'
attributes in EVERY tag.

Is there some way to suppress the xml attributes?

Are there working examples of mixing HTML with XLIFF?

FYI, I'm using XMLSpy 4.4 to validate and the Microsoft XSLT engine


Doug D

Ektron, Inc.
+1 603 594-0249

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

Powered by eList eXpress LLC