[oXygen-user] How to disable inserting elements?

George Cristian Bina george at oxygenxml.com
Mon Oct 31 11:14:44 CDT 2011


Hi Roderik,

oXygen allows a document to pass through invalid states as in some 
situations that may be the shortest path to the next valid state.

In your case the actual element that you introduce is valid because any 
validator will mark as invalid the following element, the one that was 
already in the document.

Of course we can compute the validity state of each of the following 
sibling elements and check that against the validity state after a 
possible insertion of an element through content completion. If there is 
a decreases in validity (a previously valid element becomes invalid) 
then we can mark that element differently in the content completion 
proposals or even not show it at all depending on an option.
We plan to implement such an improvement in the future.

The above will be a generic implementation for any schema.

Now, for the Author mode, for a specific vocabulary (schema) I think it 
is possible to implement a content completion filter extension that can 
look at the following element after the caret position and will remove 
that from the list of proposals if that is one of the elements you know 
that is allowed to appear only once.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 10/31/11 4:33 PM, Roderik Dernison wrote:
> Hi,
>
> I’ve got my schema working quite well at the moment. But it can use some
> more restrictions. For example when my topic already contains a
> read-more element, it is possible to insert a read-more element before it.
>
> I found out that in DITA it is possible to insert a title element before
> another title element. After inserting the second title element oXygen
> shows an error message that only one title element is allowed.
>
> The same goes for my schema. I cannot insert the same element after an
> element but can insert it before it, although only one of the same
> element is allowed.
>
> How can I prevent (if it is possible at all) to insert the same element
> before the same type of element?
>
> For example, this is possible in DITA:
>
> <topic>
>
> <!—it is possible to insert a title element here, by clicking the right
> mouse button at the title element and selecting insert before à
>
> <title>The title of the topic</title>
>
> <!—it is possible to insert a body element here à
>
> <body/>
>
> </topic>
>
> Kind regards,
>
> Roderik Dernison
>
>
> ------------------------------------------------------------------------
>
> ----------------------------------------------------------
> Aan dit bericht kunnen geen rechten worden ontleend.
> Het bericht is alleen bestemd voor de geadresseerde.
> Indien het bericht niet voor u is bestemd, verzoeken wij
> u dit aan ons te melden en het bericht te verwijderen.
>
> This message shall not constitute any obligations.
> This message is intended solely for the addressee.
> If you have received this message in error, please
> inform us and delete the message.
> ----------------------------------------------------------
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user


More information about the oXygen-user mailing list