Class XHTMLDialect

  • All Implemented Interfaces:
    XMLDialect

    public class XHTMLDialect
    extends DefaultXMLDialect
    This class specifies XHTML dialect of XML.
    • Constructor Detail

      • XHTMLDialect

        public XHTMLDialect()
    • Method Detail

      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String publicId,
                                                     java.lang.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 java.lang.Boolean validateTranslatableTagAttribute​(java.lang.String tag,
                                                                  java.lang.String attribute,
                                                                  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 java.util.regex.Pattern getSkipRegExpPattern()
      • getSkipMetaAttributes

        public java.util.HashMap<java.lang.String,​java.lang.String> getSkipMetaAttributes()
      • checkDoSkipMetaTag

        public boolean checkDoSkipMetaTag​(java.lang.String key,
                                          java.lang.String value)
      • validateIntactTag

        public java.lang.Boolean validateIntactTag​(java.lang.String tag,
                                                   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