0

I'm working with https://bitbucket.org/okapiframework and using 'core/valid/sample1.xlf' from this https://tools.oasis-open.org/version-control/browse/wsvn/xliff/trunk/xliff-20/test-suite/ I'm hitting an error

net.sf.okapi.lib.xliff2.reader.XLIFFReaderException: Error systemId: file:/tmp/sample1.xlf; lineNumber: 7; columnNumber: 43; cvc-complex-type.3.2.2: Attribute 'gls:ref' is not allowed to appear in element 'gls:glossEntry'

Any thoughts on if this is an issue with the example file or with the framework?

Thanks

brent
  • 1,095
  • 1
  • 11
  • 27

2 Answers2

1

Using a namespace prefix on an attribute is different from not using one.

<gls:glossEntry ref="#m1">

Is not the same as:

<gls:glossEntry gls:ref="#m1">

The XLIFf 2.x declaration use the un-prefixed notation (as the vast majority of all XML formats). So the first example is valid, the second is not.

BTW: There is one error in that example1.xlf file:

<gls:translation ref="#m2" source="myTermbase">TAB-TASTE

Should be:

<gls:translation ref="#t=m2" source="myTermbase">TAB-TASTE

As the m2 marker is in the target, and the ref attribute must use the XLIFF Fragment ID notation.

  • I wanted to comment on behalf of the XLIFF TC on the great answer by user1650693 since this is not really a new answer but couldn't due to low reputation ;-) All what user1650693 said in his accepted answer is spot on! I just wanted to note that I fixed the offending test suite sample1.xlf based on the correct answer. Indeed the gls: prefix had been used incorrectly in the example file and the ref syntax indeed required t= as fragid prefix to reference according to the fragid mechanism. Now the fixed file will validate alright on OKAPI Lynx and other XLIFF validators. I am considering adding t – Merzbauer Mar 17 '16 at 15:35
0

It seems to me that there is an issue with the validation tool: I used http://okapi-lynx.appspot.com/validation and got the same error. When I removed the offending ref attribute the next error reported was "Error lineNumber: 8; columnNumber: 49; cvc-complex-type.3.2.2: Attribute 'gls:source' is not allowed to appear in element 'gls:term'." According to http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/schemas/modules/glossary.xsd both attributes should be valid.

Removing the gls namespace prefix also clears the error - something is fishy there.

Jenszcz
  • 547
  • 3
  • 9