Re: question about pollo

Bruno Dumon <[email protected]> Mon, 26 Apr 2004 13:28:40 +0200
Newsgroups gmane.editors.pollo.devel
Organization Outerthought
Message-ID <[email protected]>
Please direct questions about pollo to its mailing list, so that
everyone can benefit from the answers. I'm not a free consultancy
service :-)

On Mon, 2004-04-26 at 13:16, Baruk Toledano wrote:
> Hi,
> I would like to know which algorithm you used to find the elements which 
> could be inserted before, after and in the current element.

Depends on the schema implementation.

Pollo has basically two schemas:

- it's own schema language in which you can only express parent/child
relations (i.e. this element can have these children), but no real
content models. This was introduced initially because writing "real"
schema implementations was a too big task at the time. This schema is
also presented by a simply object model in memory.

- MSV-based schemas: what I do here is walk over the schema model and
"stupidify" it to the level of what pollo's own schema language can
handle, so it is loaded into the same simple object model. (the actual
validation is of course performed by the original schema)

I've also started thinking about a more intelligent mechanism, whereby
the instance document is validated on the fly to know exactly which
childelements are allowed at a certain position. This can be seen with
the "Show Content Model" option that can be found somewhere in the menu.
What this does is validate the document up to the selected element and
then asks the validator "what do you expect here?".

This latter method is obviously the most correct one, though in many
situations the simplified model is already quite helpful (especially if
you compare it to having to remember and enter the element names
yourself).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[email protected]                          [email protected]



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297