[relaxng-user] relaxng-driven editing

James Clark jjc at jclark.com
Sat Nov 1 23:54:16 ICT 2003


On Thu, 2003-10-30 at 15:20, David Tolpin wrote:

> The problem -- my problem -- is that I am writing a program that needs to know
> 
> 1) not just the set of first elements in a pattern, but a set of
> all elements of particular kind (block-level text markup -- para,
> title, term, listitem) which do not have the opening tag of a
> preceding element in this pattern.

I don't understand what you mean by "have the opening tag of a preceding
element in this pattern".

> 
>       <listitem>
>     </itemizedlist>
>     (<para>|<itemizedlist><listitem/>+</itemizedlist>)
>   </section>*
>   <section>
>     <title>
>     ...

Is this a description of a content model or an instance or both?

> should bring '(listitem para title).

Why?

> 2) other contexts where b indirectly follows a, to decide whether it is appropriate to
> offer to close a group and/or open a new one.

So you are currently in a chapter element, say, and you get a paragraph
of text indicative of the start of a section and you need to decide
whether to close the chapter before opening the section?  Is that the
problem? Why can't you do this on the basis of parent/child
relationships i.e. leave the chapter open iff the chapter can contain a
section?

I don't think I'm going to be able to help without a lot more detail
about the problem you're trying to solve.

James





More information about the relaxng-user mailing list