Re: relaxng-driven editing

James Clark <[email protected]>
Newsgroups gmane.text.xml.relaxng.general
Message-ID <[email protected]>
On Wed, 2003-10-29 at 02:27, David Tolpin wrote:
> Hi,
> 
> if I understand it correctly, relaxng-based editors use validation algorithm as described
> in the paper about Jing (based on derivatives) to offer first elements of the current
> derivative as possible alternatives.
> 
> However, for many practical cases, the set of valid elements at any given point is determined
> by a small context of the point; for docbook, for example, it is one parent and one preceding
> element for all cases. 
> 
> RELAX NG in general may require a wider context for this approach; due to its context-dependence.
> Is there a known algorithm to build distinct lookback contexts?

I don't know of one, but I've never looked.  In nXML mode, I maintain
state that allows me to incrementally compute validity.  This state also
allows me to determine the derivative at any point, without having to
figure out what part of the context is relevant.  There's a long comment
at the beginning of the file rng-valid.el in the nXML mode distribution
that explains my approach.

James
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.