Package org.omegat.filters3.xml.xhtml
Class XHTMLDialect
- java.lang.Object
-
- org.omegat.filters3.xml.DefaultXMLDialect
-
- org.omegat.filters3.xml.xhtml.XHTMLDialect
-
- All Implemented Interfaces:
XMLDialect
public class XHTMLDialect extends DefaultXMLDialect
This class specifies XHTML dialect of XML.
-
-
Field Summary
-
Fields inherited from interface org.omegat.filters3.xml.XMLDialect
CONSTRAINT_DOCTYPE, CONSTRAINT_DOCTYPE_UNBOXED, CONSTRAINT_PUBLIC_DOCTYPE, CONSTRAINT_PUBLIC_DOCTYPE_UNBOXED, CONSTRAINT_ROOT, CONSTRAINT_ROOT_UNBOXED, CONSTRAINT_SYSTEM_DOCTYPE, CONSTRAINT_SYSTEM_DOCTYPE_UNBOXED, CONSTRAINT_XMLNS, CONSTRAINT_XMLNS_UNBOXED
-
-
Constructor Summary
Constructors Constructor Description XHTMLDialect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkDoSkipMetaTag(java.lang.String key, java.lang.String value)
void
defineDialect(XHTMLOptions options)
Actually defines the dialect.java.util.HashMap<java.lang.String,java.lang.String>
getSkipMetaAttributes()
java.util.regex.Pattern
getSkipRegExpPattern()
org.xml.sax.InputSource
resolveEntity(java.lang.String publicId, java.lang.String systemId)
Resolves external entites if child filter needs it.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 optionsjava.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.-
Methods inherited from class org.omegat.filters3.xml.DefaultXMLDialect
constructShortcuts, defineConstraint, defineContentBasedTag, defineIntactTag, defineIntactTags, defineOutOfTurnTag, defineOutOfTurnTags, defineParagraphTag, defineParagraphTags, definePreformatTag, definePreformatTags, defineShortcut, defineShortcuts, defineTranslatableAttribute, defineTranslatableAttributes, defineTranslatableTagAttribute, defineTranslatableTagAttributes, defineTranslatableTagsAttribute, getClosingTagRequired, getConstraints, getContentBasedTags, getForceSpacePreserving, getIntactTags, getOutOfTurnTags, getParagraphTags, getPreformatTags, getShortcuts, getTagsAggregationEnabled, getTranslatableAttributes, getTranslatableTagAttributes, handleXMLTag, setClosingTagRequired, setForceSpacePreserving, setTagsAggregationEnabled, validateContentBasedTag, validateParagraphTag, validatePreformatTag, validateTranslatableTag
-
-
-
-
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 returnsnull
.- Specified by:
resolveEntity
in interfaceXMLDialect
- Overrides:
resolveEntity
in classDefaultXMLDialect
-
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 interfaceXMLDialect
- Overrides:
validateTranslatableTagAttribute
in classDefaultXMLDialect
-
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 interfaceXMLDialect
- Overrides:
validateIntactTag
in classDefaultXMLDialect
- Parameters:
tag
- An XML tagatts
- The attributes associated with the tag- Returns:
false
if the content of this tag should be translated,true
otherwise
-
-