[relaxng-user] relaxng-driven editing
James Clark
jjc at jclark.com
Thu Oct 30 03:17:00 ICT 2003
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
More information about the relaxng-user
mailing list