From 2c6fe7e293425795835766319bff524ef47bb94a Mon Sep 17 00:00:00 2001 From: joehni Date: Tue, 5 Jan 2021 00:33:34 +0100 Subject: [PATCH] Fix start position of PI and comment for all reported errors (#124) This closes #124 --- .../java/org/codehaus/plexus/util/xml/pull/MXParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java b/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java index 20fdcc8e..d1c6ef18 100644 --- a/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java +++ b/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java @@ -2988,7 +2988,7 @@ private void parseComment() posStart = pos; final int curLine = lineNumber; - final int curColumn = columnNumber; + final int curColumn = columnNumber - 4; try { final boolean normalizeIgnorableWS = tokenize && !roundtripSupported; @@ -3109,7 +3109,7 @@ private boolean parsePI() if ( tokenize ) posStart = pos; final int curLine = lineNumber; - final int curColumn = columnNumber; + final int curColumn = columnNumber - 2; int piTargetStart = pos; int piTargetEnd = -1; final boolean normalizeIgnorableWS = tokenize && !roundtripSupported; @@ -3156,7 +3156,7 @@ else if ( !seenInnerTag ) { // seenPITarget && !seenQ throw new XmlPullParserException( "processing instruction started on line " + curLine - + " and column " + (curColumn -2) + " was not closed", this, null ); + + " and column " + curColumn + " was not closed", this, null ); } } else if ( ch == '<' )