Just thought about a potential use case for storing the offset: error
reporting.
We'll also need it if we want to do auto completion in the wiki editor
which I think would be nice to have.
Ok I'll try to add offset/length to the rendering module. It's going
to cost us some performance actually since when there are block
transformations you need to recompute the blocks offsets... I still
need to know how it's best to store them for your needs Malaka.
Storing them in the Blocks themselves might cost too much to retrieve
them. I could also store them in some other structure with references
to the blocks. Let me know what you need.
Thanks
-Vincent
On Jul 1, 2008, at 10:19 AM, Vincent Massol wrote:
Hi Malaka,
On Jul 1, 2008, at 6:20 AM, malaka ekanayake wrote:
Hi vincent
Now I'm working on the costume implementation of the IDocument
Partitioner which uses the XDOM parser.
But in order to to register partitions with the
IDocument,requires the offset and the length of each token returned
by the parser.
Did you get Marius' input on this?
I remember I said:
"
* Re the offset and lengthn I think this is something interesting that
could be added to the new rendering module. Since the underlying
parsers (wikimodel, doxia) don't pass this information to us we would
need to compute it. It would allow us to answer the question "what
block is located at location NN in the source document".
* We need to get Marius' input since he's working on the new WYSIWYG
editor for XWiki and maybe he has some similar needs/issues.
"
The reason I said this is because if the only requirement is for your
use case then you could easily compute the offset/lenght for your use
case only (by writing a very simple Listener and running
XDOM.traverse(yourllistener). However if the need is generic then it
makes sense to have it in the rendering component itself.
I'm still hesitating about the generic need about this.
If we agree to add it in the rendering component then I can implement
it for you.
Another question for you: once you have this information what's the
algorithm for finding the block that corresponds to a given location
in the source document? Dichotomy on the tree?
Thanks
-Vincent
But the current implementation of the parser
don't have that
information.Do I need to look at that issuer as well or what?
I have very little understanding of the implementation of the
parser and I will be difficult for me to implement that
functionality.
Vincent can you help me on this issuer.
-- Malaka Ekanayake
CSE UOM
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs