I'd like to use LanguageTool to check the spelling and grammar for the text contained in an XML file, adjusting error positions so they refer to the original text including markup.
For "Example 1" I've managed to do this by calling the method check(String) of the class org.languagetool.JLanguageTool
But for "Example 2" this didn't work (no errors were detected). I suppose the reason is that "A" is nested inside the "" element.
Which is the best way to analyze a text (containing markup) with LanguageTool adjusting error positions so they refer to the original text including markup?
Thanks in advance.