[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [xliff] Extensibility methods
Hi David, Rodolfo, all, > I agree with you, <matches> should live in a module > and I tried to move it to a module. Unfortunately, > <matches> content is too related to <source> and > <target> and we cannot separate <matches> from the > rest using namespaces. I agree too that it should be in a separate module. I'm certainly no expert in XML Schema, and I may be wrong, but we should be able to use types of the XLIFF core into other modules. Complex types can be used recursively, so I don't see why they could not be used recursively across namespaces as well. If I declare <matches> and <match> in a separate XSD module, using a reference to the source, target and originalData types declared in the core, like this: <xs:element name="match"> <xs:complexType> <xs:sequence> <xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/> <xs:element minOccurs="1" maxOccurs="1" ref="xlf:target"/> <xs:element minOccurs="0" maxOccurs="1" ref="xlf:originalData"/> </xs:sequence> <xs:attribute name="id" use="optional" type="xs:NMTOKEN"/> <xs:attribute name="origin" use="optional"/> <xs:attribute name="matchquality" use="optional" type="xs:integer"/> </xs:complexType> </xs:element> And in the core module do this: <xs:element name="segment"> <xs:complexType> <xs:sequence> <xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/> <xs:element minOccurs="0" maxOccurs="1" ref="xlf:target"/> <xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/> <xs:element minOccurs="0" maxOccurs="1" ref="m:matches"/> </xs:sequence> <xs:attribute name="id" use="optional" type="xs:NMTOKEN"/> <xs:attribute name="translate" type="xlf:yesNo" default="yes"/> <xs:attribute name="approved" type="xlf:yesNo" default="no"/> </xs:complexType> </xs:element> Everything seems to be ok. And when I have an XLIFF document like this: <xliff version='2.0' xmlns="urn:oasis:names:tc:xliff:document:2.0" xmlns:m="urn:oasis:names:tc:xliff:matches:2.0" srcLang='en'> <file> <unit id='1'> <segment> <source>text</source> <m:matches> <m:match> <source>text</source> <target>target</target> </m:match> </m:matches> </segment> </unit> </file> </xliff> It seems to work fine and pass validation as well. I've attached the three files. Am I missing something? Cheers, -yves
Attachment:
MatchModuleTest.zip
Description: Zip compressed data
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]