OASIS XML Localisation Interchange File Format (XLIFF) TC

RE: [xliff] Another spec question - processing requirements for state attribute

  • 1.  RE: [xliff] Another spec question - processing requirements for state attribute

    Posted 04-07-2022 11:06
    Hi Yoshito, The core XML Schema defines state attribute like this:       <xs:attribute name= state use= optional type= xlf:stateType default= initial /> where xlf:stateType is an enumeration with four values. Your example   <segment>     <source>Foo</source>     <target>Bar</target>   </segment> is legal. The fragments   <segment> and <segment state= initial > are not equivalent.  As the use of state is optional, parsers don't apply the default value when processing a file.  So, we are dealing with an XML grammar trick here.  Your concerns would be valid if we were still using DTDs to define the grammars. We are using XML Schema now because DTDs can't express what the specification says.  The Schematron rules shipped with XLIFF 2.0 / 2.1 are broken due to this XML Schema trick. They say that valid XLIFF files have errors because the state attribute is not properly handled.  Regards, Rodolfo  -- Rodolfo M. Raya Maxprograms http://www.maxprograms.com