I think to do this you need to override the scanner for your composite DWM_REPEAT tag. Specifically you need to do something in Tag scan(Tag tag, Lexer lexer, NodeList stack) and then call the superclass.
So, your DWM_REPEAT tag prototype uses setThisScanner to use an overridden scanner, which subclasses CompositeScanner and overrides scan() to do the needful and then calls super.scan().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I was wondering if its possible that when parser(file.html) is running can you query your parent for information?
So if i start mParser.parse(null) this will trip all my custom tag handlers whilst it parses the html page.
Some pages I have sections like:
<DMW_REPEAT SQL="query string">
<DMW_EXEC ....
</DMW_EXEC>
</DMW_REPEAT>
So what I want to do is pull out the SQL query, go off and get its results, then apply the results to the DMW_EXEC tags.
From what I can see the parser will know about the SQL attribute/value till after it finishes parsing the DMW_EXEC tags.
Is it possible to find out the contents of DMW_REPEAT before parsing the DMW_EXEC tags?
Thanks in advance,
Colin.
I think to do this you need to override the scanner for your composite DWM_REPEAT tag. Specifically you need to do something in Tag scan(Tag tag, Lexer lexer, NodeList stack) and then call the superclass.
So, your DWM_REPEAT tag prototype uses setThisScanner to use an overridden scanner, which subclasses CompositeScanner and overrides scan() to do the needful and then calls super.scan().