OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Auto-completion in editors (RE: [xml-dev] ANN: XML Origin,

[ Lists Home | Date Index | Thread Index ]

> I think the tricky part comes when the user jumps (mouse, keyboard action)
> to another part of the document - where/how do you pick up the context?
> where and how do you save the current context?

I wrote a small editor that I use every day-- but is maybe not the most
efficient. It uses a SAX parser (AElfred2/Delphi) and attempts to parse the
document as it is changed. When the document is parsed I save the locator
information-- when the SAX Parse hits an error (WF) then it stops. That is
the end of the locator info. This gives columns and line numbers as the user
navigates. Obviously in Bi-directional text or Right To Left reading SAX
stops being useful in terms of document location.

This could all be optimized to continue parsing at a certain point-- or
magically understand document changes at certain points. I could also add a
better hashing mechanism to position lookups-- it is pretty fast though--
looking up the position in the tree is quick as you can jump through the
nodes hierarchally.

HTH,
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS