+ column/line error position in RDF/XML parser
authorAlexandre Bertails <bertails@w3.org>
Tue, 28 Dec 2010 10:56:35 -0500
changeset 291 2376822979b7
parent 290 2f42582ab077
child 292 d06a179b434d
+ column/line error position in RDF/XML parser
rdfxml/src/main/scala/RDFXML.scala
--- a/rdfxml/src/main/scala/RDFXML.scala	Thu Dec 02 16:46:04 2010 -0500
+++ b/rdfxml/src/main/scala/RDFXML.scala	Tue Dec 28 10:56:35 2010 -0500
@@ -51,7 +51,9 @@
 case class ParseError(
   val message:String,
   val errorType:ParseErrorType,
-  val level:ParseErrorLevel)
+  val level:ParseErrorLevel,
+  val column:Int,
+  val line:Int)
 
 object ParseError {
   def fromSAXParseException(e:SAXParseException, level:ParseErrorLevel):ParseError = {
@@ -61,7 +63,7 @@
       if      (message.size > 1 && message(1) == 'W') Warning
       else if (message.size > 1 && message(1) == 'E') Error
       else    level
-    new ParseError(message, errorType, correctedLevel)
+    new ParseError(message, errorType, correctedLevel, e.getColumnNumber, e.getLineNumber)
   }
 }