Skip to content

Commit a936a9c

Browse files
joehnignodet
authored andcommitted
Fix start position of PI and comment for all reported errors.
1 parent b14ed2e commit a936a9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,7 @@ private void parseComment()
29352935
posStart = pos;
29362936

29372937
final int curLine = lineNumber;
2938-
final int curColumn = columnNumber;
2938+
final int curColumn = columnNumber - 4;
29392939
try
29402940
{
29412941
final boolean normalizeIgnorableWS = tokenize && !roundtripSupported;
@@ -3056,7 +3056,7 @@ private boolean parsePI()
30563056
if ( tokenize )
30573057
posStart = pos;
30583058
final int curLine = lineNumber;
3059-
final int curColumn = columnNumber;
3059+
final int curColumn = columnNumber - 2;
30603060
int piTargetStart = pos;
30613061
int piTargetEnd = -1;
30623062
final boolean normalizeIgnorableWS = tokenize && !roundtripSupported;
@@ -3103,7 +3103,7 @@ else if ( !seenInnerTag )
31033103
{
31043104
// seenPITarget && !seenQ
31053105
throw new XmlPullParserException( "processing instruction started on line " + curLine
3106-
+ " and column " + (curColumn -2) + " was not closed", this, null );
3106+
+ " and column " + curColumn + " was not closed", this, null );
31073107
}
31083108
}
31093109
else if ( ch == '<' )

0 commit comments

Comments
 (0)