Class XHTMLDialect

java.lang.Object
org.omegat.filters3.xml.DefaultXMLDialect
org.omegat.filters3.xml.xhtml.XHTMLDialect
All Implemented Interfaces:
XMLDialect

@NullMarked public class XHTMLDialect extends DefaultXMLDialect
This class specifies XHTML dialect of XML.
  • Constructor Details

    • XHTMLDialect

      public XHTMLDialect()
  • Method Details

    • resolveEntity

      public @Nullable InputSource resolveEntity(@Nullable String publicId, String systemId)
      Resolves external entites if child filter needs it. Default implementation returns null.
      Specified by:
      resolveEntity in interface XMLDialect
      Overrides:
      resolveEntity in class DefaultXMLDialect
    • defineDialect

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

      public Boolean validateTranslatableTagAttribute(String tag, String attribute, @Nullable Attributes atts)
      Returns for a given attribute of a given tag if the attribute should be translated with the given other attributes present. If the tagAttribute is returned by getTranslatable(Tag)Attributes(), this function is called to further test the attribute within its context. This allows for example the XHTML filter to not translate the value attribute of an input-element, except when it is a button or submit or reset.
      Specified by:
      validateTranslatableTagAttribute in interface XMLDialect
      Overrides:
      validateTranslatableTagAttribute in class DefaultXMLDialect
    • getSkipRegExpPattern

      public @Nullable Pattern getSkipRegExpPattern()
    • getSkipMetaAttributes

      public @Nullable HashMap<String,String> getSkipMetaAttributes()
    • checkDoSkipMetaTag

      public boolean checkDoSkipMetaTag(String key, String value)
    • validateIntactTag

      public Boolean validateIntactTag(String tag, @Nullable Attributes atts)
      In the XHTML filter, content should be translated in the following condition: The pair attribute-value should not have been declared as untranslatable in the options
      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