Class Xhtml1BaseParser

All Implemented Interfaces:
HtmlMarkup, Markup, XmlMarkup, Parser
Direct Known Subclasses:
XdocParser

public class Xhtml1BaseParser extends Xhtml5BaseParser
Acts as bridge between legacy parsers relying on XHTML 1.0 Transitional (based on HTML4) and the Xhtml5BaseParser only supporting (X)HTML5 elements/attributes. Adds support for elements/attributes which became obsolete in HTML5 but are commonly used for XDoc/FML.
See Also:
  • Field Details

  • Constructor Details

    • Xhtml1BaseParser

      public Xhtml1BaseParser()
  • Method Details

    • mapAlignToStyle

      static final String mapAlignToStyle(String alignValue)
    • baseStartTag

      protected boolean baseStartTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Sink sink)
      Translates obsolete XHTML 1.0 attributes/elements to valid XHTML5 ones before calling the underlying Xhtml5BaseParser.
      Overrides:
      baseStartTag in class Xhtml5BaseParser
      Parameters:
      parser - A parser.
      sink - the sink to receive the events.
      Returns:
      True if the event has been handled by this method, i.e. the tag was recognized, false otherwise.
    • baseEndTag

      protected boolean baseEndTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Sink sink)
      Description copied from class: Xhtml5BaseParser

      Goes through a common list of possible html end tags. These should be re-usable by different xhtml-based parsers. The tags handled here are the same as for Xhtml5BaseParser.baseStartTag(XmlPullParser,Sink), except for the empty elements (<br/>, <hr/>, <img/>).

      Overrides:
      baseEndTag in class Xhtml5BaseParser
      Parameters:
      parser - A parser.
      sink - the sink to receive the events.
      Returns:
      True if the event has been handled by this method, false otherwise.