Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get current position in XML document

Tags:

xml

sax

I am going to read XML elements and store in a B+-tree file, I need to know the position pointer for each element XML to store as nodes in the B+-tree. I want to know how to get these pointers of XML elements during the SAX reads

like image 798
RashaAziz Avatar asked Nov 28 '25 06:11

RashaAziz


1 Answers

In your DocumentHandler implementation, add an implementation for setDocumentLocator() to accept the Locator provided by your parser implementation. This class can be used to query the current position in the document at each SAX event.

like image 89
Jim Garrison Avatar answered Nov 29 '25 20:11

Jim Garrison



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!