Class HtmlTableConfiguration
Specifies configuration options for HTML table comparison. These configuration options can be specified on a
ConcurrentMerge, SequentialMerge and ThreeWayMerge to configure its behavior when comparing tables.
- Since:
- 8.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theHtmlColumnKeyingModecurrently in use when comparing HTML tables.Returns the current behavior in use when inputs contain invalid HTML tables.Returns theValidationLevelcurrent in use when validating HTML tables.Returns theWarningReportModein use when invalid HTML tables are encountered.booleanDetermines whether ignoring CALS table column order is enabled.booleanDetermines whether HTML table column specification is normalized.booleanDetermines whether HTML table processing is enabled.voidSets theHtmlColumnKeyingModeto use when comparing HTML tables.voidsetIgnoreColumnOrder(boolean ignoreColumnOrder) Sets whether theDocumentComparatorshould ignore CALS table column order.voidsetInvalidTableBehaviour(InvalidTableBehaviour behaviour) In order to ensure that only valid HTML tables are passed to our specialized HTML table processing, each input table is marked either valid or invalid.voidsetNormalizeTable(boolean value) Sets whether the XML Merge should normalize the specification of columns in HTML tables.voidsetProcessTables(boolean value) Specifies whether to apply HTML table or DITA simpletable processing.voidSets theValidationLevelto use for HTML table validation.voidSpecifies how HTML table invalidity warnings should be reported.
-
Constructor Details
-
HtmlTableConfiguration
public HtmlTableConfiguration()Constructs a newHtmlTableConfigurationinstance.
-
-
Method Details
-
setProcessTables
public void setProcessTables(boolean value) Specifies whether to apply HTML table or DITA simpletable processing.
HTML tables processing ensures that when valid input tables are provided - according to the HTML 4 or HTML 5 documentation - the result will be a valid HTML 4/5 table. Note that both inputs need to follow the same standard (i.e. be HTML 4 or HTML 5).
Simple changes to the table, such as changing the contents of a cell and adding a row or column are generally represented as fine grain changes. Because HTML entries can overlap or span multiple rows and columns, some types of change are difficult to represent at fine granularity, whilst ensuring validity. In these cases changes are represented at row (ie, groups of added/deleted rows) or even whole-table granularity.
DITA Simple tables are also handled by this filter. In this case, the syntactic constraints ensure that cells cannot overlap or span either rows or columns, therefore changes are represented at a fine grained level of detail.
Setting this parameter to
falseturns off this processing, therefore it is possible to generate an invalid table. However, if table validity is not a concern changes may be represented at finer granularity.Default:
true- Parameters:
value- a boolean value to enable HTML table processing
-
isProcessTables
public boolean isProcessTables()Determines whether HTML table processing is enabled.
- Returns:
- a boolean describing the enabled state of HTML table processing
-
setValidationLevel
Sets the
ValidationLevelto use for HTML table validation.A value of
ValidationLevel.STRICTwill cause theInvalidTableBehaviourmode to be used for any HTML invalidity. A value ofValidationLevel.RELAXEDmeans that invalidities which are known to have no effect on HTML processing will not prevent HTML processing from running. N.B. Warnings will be reported according to theWarningReportModeregardless of the setting used here.- Parameters:
level- an instance ofValidationLeveldescribing the level to use
-
getValidationLevel
Returns the
ValidationLevelcurrent in use when validating HTML tables.- Returns:
- an instance of
ValidationLeveldescribing the level in use
-
setInvalidTableBehaviour
In order to ensure that only valid HTML tables are passed to our specialized HTML table processing, each input table is marked either valid or invalid. This parameter declares what type of processing should be used for those tables that are marked as invalid. The 'warning report mode' parameter configures how recoverable errors are reported.
Three options are provided: fail, propagate up, and compare as XML. The fail option stops the comparison by throwing an appropriate exception (that includes the errors identified by the validity checker). The propagate up option ensures that changes to an invalid table are represented at the table level. The compare as XML option essentially compares the tables as if they were well-formed XML.
Note that the results of the compare as XML option can differ from comparing the tables without HTML table processing enabled, as a small amount of HTML specific processing is applied to invalid tables in order to allow them to be compared against a similar valid table.
Default:
InvalidTableBehaviour.PROPAGATE_UP- Parameters:
behaviour- the value to set for the InvalidTableBehaviour parameter- Throws:
IllegalArgumentException- if the value is null- See Also:
-
getInvalidTableBehaviour
Returns the current behavior in use when inputs contain invalid HTML tables.- Returns:
- an instance of
InvalidTableBehaviourdescribing the behavior in use
-
setWarningReportMode
Specifies how HTML table invalidity warnings should be reported.- Parameters:
mode- theWarningReportModeto use when invalid HTML tables are encountered
-
getWarningReportMode
Returns theWarningReportModein use when invalid HTML tables are encountered.- Returns:
- an instance of
WarningReportModedescribing the reporting mode in use
-
setNormalizeTable
public void setNormalizeTable(boolean value) Sets whether the XML Merge should normalize the specification of columns in HTML tables.
This setting is recommended when there is a difference between inputs of specifying columns, e.g. if one uses just <colgroup> and another uses <col> without <colgroup>.
- Parameters:
value- whether to normalize HTML Table column specification
-
isNormalizeTable
public boolean isNormalizeTable()Determines whether HTML table column specification is normalized.
- Returns:
- a boolean describing the enabled state of normalization of HTML Table column specification
-
setIgnoreColumnOrder
public void setIgnoreColumnOrder(boolean ignoreColumnOrder) Sets whether the
DocumentComparatorshould ignore CALS table column order.- Parameters:
ignoreColumnOrder- whether to ignore CALS table column order
-
isIgnoreColumnOrder
public boolean isIgnoreColumnOrder()Determines whether ignoring CALS table column order is enabled.
- Returns:
- a boolean describing whether the CALS table column order is ignored
-
setHtmlColumnKeyingMode
Sets the
HtmlColumnKeyingModeto use when comparing HTML tables.- Parameters:
mode- an instance ofHtmlColumnKeyingModedescribing the keying mode to use
-
getHtmlColumnKeyingMode
Returns the
HtmlColumnKeyingModecurrently in use when comparing HTML tables.- Returns:
- an instance of
HtmlColumnKeyingModedescribing the keying mode in use
-