Class XmlOffsetCorrector


  • public class XmlOffsetCorrector
    extends OffsetCorrector
    Corrects offsets to adjust for XML formatted data. The goal is such that the caller should be able to insert a start XML tag at the start offset and a corresponding end XML tag at the end offset of the tagger, and have it be valid XML. See OffsetCorrector.correctPair(int, int). This will not work on invalid XML. Not thread-safe.
    • Constructor Detail

      • XmlOffsetCorrector

        public XmlOffsetCorrector​(String docText)
                           throws XMLStreamException
        Initialize based on the document text.
        Parameters:
        docText - non-null XML content.
        Throws:
        XMLStreamException - If there's a problem parsing the XML.