Class XLIFFDialect

  • All Implemented Interfaces:
    XMLDialect

    public class XLIFFDialect
    extends DefaultXMLDialect
    This class specifies XLIFF XML Dialect. XLIFF 1.2 specification: http://docs.oasis-open.org/xliff/xliff-core/xliff-core.html
    • Constructor Detail

      • XLIFFDialect

        public XLIFFDialect()
    • Method Detail

      • defineDialect

        public void defineDialect​(XLIFFOptions options)
        Actually defines the dialect. It cannot be done during creation, because options are not known at that step.
      • validatePreformatTag

        public java.lang.Boolean validatePreformatTag​(java.lang.String tag,
                                                      Attributes atts)
        In the XLIFF filter, the tag <mrk> is a preformat tag when the attribute "mtype" contains "seg".
        Specified by:
        validatePreformatTag in interface XMLDialect
        Overrides:
        validatePreformatTag in class DefaultXMLDialect
        Parameters:
        tag - An XML tag
        atts - The attributes associated with the tag
        Returns:
        true if this tag should be a preformat tag, false otherwise
      • validateIntactTag

        public java.lang.Boolean validateIntactTag​(java.lang.String tag,
                                                   Attributes atts)
        In the XLKIFF filter, content shouldn't be translated if translate="no" http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#translate
        Specified by:
        validateIntactTag in interface XMLDialect
        Overrides:
        validateIntactTag in class DefaultXMLDialect
        Parameters:
        tag - An XML tag
        atts - The attributes associated with the tag
        Returns:
        false if the content of this tag should be translated, true otherwise
      • validateContentBasedTag

        public java.lang.Boolean validateContentBasedTag​(java.lang.String tag,
                                                         Attributes atts)
        Description copied from interface: XMLDialect
        For a given tag, return wether the content of this tag should be translated, depending on the content of one attribute and the presence or absence of other attributes.
        Specified by:
        validateContentBasedTag in interface XMLDialect
        Overrides:
        validateContentBasedTag in class DefaultXMLDialect
        Parameters:
        tag - The tag that could be translated
        atts - The list of the tag attributes
        Returns:
        true or false
      • handleXMLTag

        public void handleXMLTag​(XMLTag tag,
                                 boolean translated)
        Handle <target state="..."> attribute according to filter settings.
        Specified by:
        handleXMLTag in interface XMLDialect
        Overrides:
        handleXMLTag in class DefaultXMLDialect
        Parameters:
        tag - XML tag to be processed.
        translated - is the value considered translated?
        See Also:
        RFE #1506