Tweaking XOM parser – element position support

XOM parser is a great piece of code. I was missing just one feature – to be able to get position of element in source file (line and column). So I did a quick and dirty hack resulting in two new nu.xom.Element methods: getLineNumber() and getColumnNumber().

Works nice when used in conjunction with org.apache.xerces.parsers.SAXParser (but wasn’t tested with anything else so take care…).

If you’re interested, download the original xom-1.1.zip file, unpack and unpack all files from my xom-1.1.position.patch.zip over original ones.

Tags: ,

Comments are closed.