XML and text positions in original document

M

max

Hello!

There is a score of really good HTML/XML-parsers around. But I need a
DOM representation where every Node points to row/column positions of
the original text.

Example XML:
<html>
<body>
<p>Test</p>
</body>
</html>

After parsing Java should be able to render something like along the
line:

Element pElement = (Element) XmlUtil.getNode(htmlDoc, "html/body/p");
int srow = pElement.getStartRow(); //would render 3
int scol = pElement.getStartColumn(); //would render 5
int erow = pElement.getEndRow(); //would render 3
int ecol = pElement.getEndColumn(); //would render 16

Such a function seems to be integrated into Eclipe, but I have not
found the right API for it yet. Can anybody help or provide code
examples?


Best regards,
Max.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top