[zanata-devel] Zanata's XliffReader class

Sean Flanigan sflaniga at redhat.com
Wed Dec 14 07:46:59 UTC 2016


Hi Haiwei,

You were asking on freenode:

<hsnyc> Hey guys, I have a question about supporting Xliff type of files.
> Inside XliffCommon.java file, the function getContentElementList() defines
> several element that are not eligible to use in Xliff type of file. In
> XliffReader.java file, get ElementValue() function, it throws errors if
> legalElements.contains(localName). I want to ask why do you guys choose to
> exclude these tags and what if the input sdlxlf file contains one of these
> tag
> <hsnyc> Thanks a lot in advance! Much appreciate if you can email your
> thoughts to my email haiwei.su at motaword.com.


The existing XLIFF support in Zanata is very old and unfortunately only
supports one particular subset of XLIFF (very flat XLIFF, almost like
properties files), not general XLIFF support at all. That's why we don't
tend to mention XLIFF support, eg on the zanata.org home page.

I think the code you found in XliffReader just tries to give a better error
message, depending on whether the elements are legal or illegal in XLIFF.
XliffReader was not written to handle these nested elements, even where
they are legal.


If someone were to implement proper support for XLIFF, it would be better
to make a new OkapiFilterAdapter for XLIFF, which should be able to handle
hierarchical XLIFF much better than the old approach ever could.

In terms of complexity, TSAdapter is probably closest to what an
XLIFFAdapter would need to cover.


If you have any more questions, please join and ask on the zanata-devel
mailing list (CCed): http://zanata.org/mailing-lists/


Regards



Sean.

-- 
Sean Flanigan

Principal Software Engineer
Globalisation Tools Engineering
Red Hat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/zanata-devel/attachments/20161214/63b1faa3/attachment.htm>


More information about the zanata-devel mailing list