- edited description
net.sf.okapi.lib.xliff2.metadata.Meta.setType() should accept empty strings
The type attribute on mda:meta isn’t limited to non-empty strings, so checking that its value isn’t empty isn’t right. The patch for this is simple, just change the test to
type == null
on line 69 of Meta.java, see
For further reference, see the XML Schema for mda:meta,
http://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html#metadata_schema
The relevant part is
<xs:element name="meta">
<xs:complexType mixed="true">
<xs:attribute name="type" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
and, as I’m sure you know, this doesn’t limit type to non-empty strings. The type would have to be something along the lines of
<simpleType name="non-empty-string">
<restriction base="xs:string">
<minLength value="1"/>
</restriction>
</simpleType>
for that to be the case.
Now I haven’t looked at the rest of the code that uses Meta.getType() to verify that no callers expect a non-empty string. I assume that you know where to look to apply any further necessary patches. The comments on line 32 and line 40 should be updated to reflect that type must only be non-null.
Thank you!
Nikolai
Comments (3)
-
reporter -
-
assigned issue to
-
assigned issue to
-
- changed status to resolved
The type attribute for <mda:meta> now allows an empty string. This resolves issue
#20.→ <<cset 3d0064ef44eb>>
This is fixed. Thanks you for reporting the issue. You can check the behavior at http://okapi-lynx.appspot.com/validation empty type should be allowed now.
- Log in to comment