Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Lexical information?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: <nu.xom AT io7m.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Lexical information?
  • Date: Tue, 31 May 2016 15:04:47 +0000

Hello.

I'm writing a program that accepts a XOM-produced AST and performs
various operations on it.

There are various properties of the AST that cannot be expressed by a
RELAX-NG or XSD schema, so there are inevitably errors that need to be
raised when the AST is invalid in some way. In order to allow those
errors to be acceptable to users, I need to be able to show them
line and column numbers indication the locations of the errors.

The problem: XOM appears to discard all lexical information (if any is
even provided by the underlying parser). Is there any way I can arrange
for lexical information to be preserved in any way? I'm open to any
suggestion whatsoever (even populating an IdentityHashMap that maps XOM
produced nodes to lexical information would be fine).

I would assume that the solution would first involve getting SAX or
whatever is doing the parsing to supply that information (which it
presumably does at some point, because many of the exception types have
line and column information). I would then somehow need to intercept
that information before XOM consumes it, and then somehow associate the
produced XOM nodes with the information I intercepted.

M




Archive powered by MHonArc 2.6.24.

Top of Page