Content completion in XML documents with RELAX NG schemas

Having trouble installing Oxygen? Got a bug to report? Post it all here.
anayram
Posts: 17
Joined: Wed Oct 28, 2009 8:35 pm

Content completion in XML documents with RELAX NG schemas

Post by anayram »

Hi,

Having the same problem. We are migrating from SGML DTDs to schemas, and I am working with Relax NG (its flexibility turned out to be very good for sorting out the inclusions / exclusions issue).

Our previous SGML editor (used by content authors) populated either default values or the first choice particle in a list of attribute values.

I tried using the "content completion" form in Oxygen's Preferences panel, checked "use content completion", "add element content", "add first choice particle", "insert the required attributes", "insert the fixed attributes", but still, when I create an instance document and add a new element, the content is not populated.

Any help would be greatly appreciated!
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Content completion in XML documents with RELAX NG schemas

Post by sorin_ristache »

Hello,

The Content Completion preferences are applied by the content completion assistant both in Text mode and Author mode. The preferences are applied for RELAX NG schemas too. If they are not applied in your case please post a small sample XML document and the RELAX NG schema that is associated with it and specify the location of the cursor when you invoke the content completion assistant.


Thank you,
Sorin
anayram
Posts: 17
Joined: Wed Oct 28, 2009 8:35 pm

Re: Content completion in XML documents with RELAX NG schemas

Post by anayram »

We are new to Oxygen and XML so I am going to explain the issue in layman terms, hope you don't mind!

Our previous SGML editor (used by content authors in Author mode only) automatically populated either default (fixed) values, or inserted the first choice particle in a list of required attribute values. All this without the user having to choose from a drop down menu, simply, the value was inserted whether the user made a choice or not.

I understand that Oxygen's Content Completion Assistant provides a list of value choices when editing in the "Text View." Our authors are academics who edit in in "Author Mode," rather than plain text editor. We would like attribute values (fixed or first choice when required attributes) to be automatically inserted at the moment of adding a new tag.

If I am correct, I think the Content Completion Assistant does not provide what we need. In this case, the "content completion" form in Oxygen's Preferences panel ("use content completion", "add element content", "add first choice particle", "insert the required attributes", "insert the fixed attributes") would only work in Text View and would not automatically insert values. :?

Is it possible to get this functionality from Oxygen?

Thanks!
anayram
Posts: 17
Joined: Wed Oct 28, 2009 8:35 pm

Re: Content completion in XML documents with RELAX NG schemas

Post by anayram »

BTW, how can I send you a sample schema (if needed)?

Cheers,
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Content completion in XML documents with RELAX NG schemas

Post by george »

There should be no difference on what it is inserted in the document when you pick a proposal from the content completion list no matter if you are in Text or Author mode.

You can send a sample to show the issue at support at oxygenxml.com.

Best Regards,
George
George Cristian Bina
anayram
Posts: 17
Joined: Wed Oct 28, 2009 8:35 pm

Re: Content completion in XML documents with RELAX NG schemas

Post by anayram »

george wrote:There should be no difference on what it is inserted in the document when you pick a proposal from the content completion list no matter if you are in Text or Author mode.
Thank you,

Is there a way to have Oxigen inserting the first choice particle without having to pick it from the content completion list?

Here is an example: in my schema I have a <date> element that defines two required attributes ("calendar" and "cert", each attribute having a list of possible values). While working in Author mode, say that I add a <date> element, I would like Oxigen to fill for me the "calendar" and "cert" values and adding automatically the first choice in the list of values, without having to pick anything from the content completion form. Is this possible?

Thanks,
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Content completion in XML documents with RELAX NG schemas

Post by george »

Hi,

No, we do not do automatic addition of attribute values. The content completion options refer to adding elements and attributes, not to values.
The possible values are presented when you edit the attribute value in a drop down list.

Please note that the Author mode has a powerful extensibility support and you if you can have both custom actions that can insert fragments of code depending on the context. Also you can even get full access to the Author internal structure and modify it automatically by inserting for example the attributes values automatically. See the developer page for details.

Best Regards,
George
George Cristian Bina
Post Reply