Define/add new entities in Entities window

Oxygen general issues.
strivinglife
Posts: 9
Joined: Tue Jan 13, 2009 3:08 pm
Location: Madison WI
Contact:

Define/add new entities in Entities window

Post by strivinglife »

I'm not finding anything in the help doc, and http://www.oxygenxml.com/forum/topic2633.html isn't specifically helping (although it may contain the answer).

Is it possible to add new entities in the Entities view?

Similarly, in Author view, it's possible to right-click and use the Insert Entity function, which pulls from some listing. If it's different than the Entities window, is it possible to add new entities here as well?

Thanks,

~James
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Define/add new entities in Entities window

Post by sorin_ristache »

Hello,

The Entities view displays the entities declared in the current XML document. If an entity is not declared but you want to add it to the view with an action like Add Entity then a declaration must also be added to the document because if you insert that entity in the document with a double click in the view and it is not declared then you have a validation error. We will consider adding an entity declaration to the document with an action Add Entity in the view.


Thank you for your request,
Sorin
strivinglife
Posts: 9
Joined: Tue Jan 13, 2009 3:08 pm
Location: Madison WI
Contact:

Re: Define/add new entities in Entities window

Post by strivinglife »

Any news on this?

We're actually running into this issue with XML that use XSDs, which doesn't seem to support the addition of new entities.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Define/add new entities in Entities window

Post by sorin_ristache »

An XML document that declares an XSD schema does support adding new entities. For example:

Code: Select all

<!DOCTYPE personnel [
<!ENTITY ent "some_entity">
]>
<personnel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="personal.xsd">
<person id="Big.Boss">
<name>
<family>Boss &ent;</family>
<given>Big</given>
</name>
<email>chief@oxygenxml.com</email>
<link subordinates="one.worker"/>
</person>
</personnel>
You can just add a DOCTYPE section at the beginning of the XML file.

An action for inserting an entity reference in the XML document for an entity that is not declared (which means the action must also insert the declaration of the entity in the DOCTYPE section) was not implemented yet in Oxygen. We will consider it for a future version of Oxygen.


Regards,
Sorin
Oleksii
Posts: 81
Joined: Wed Jul 19, 2017 6:04 pm
Location: Austria
Contact:

Re: Define/add new entities in Entities window

Post by Oleksii »

We use RelaxNG to validate our XML files and I wanted to add a DTD just to use it for the entities references.
When I define the following combination DTD and Relax NG coexist fine, so there is access to the defined entities and the file is not validated against DTD:
    The validation scenario uses detected schema or external schema and .dtd is referenced from the XML-file.

    Code: Select all

    <?xml-model href="../../schemas/mei-DME.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
    <!DOCTYPE mei SYSTEM "../../../../../working-set/oxy_templates/entities.dtd">

    When I wanted to add the DTD to the same validation scenario (especially needed for the document type association), the XML structure is validated also by the DTD which causes a validation failure of course.
    Kind regards,
    Oleksii Sapov-Erlinger
    Oleksii
    Posts: 81
    Joined: Wed Jul 19, 2017 6:04 pm
    Location: Austria
    Contact:

    Re: Define/add new entities in Entities window

    Post by Oleksii »

    Also I noticed a bug: when I update the .dtd file the are problems with updating the entities references in the xml
    Kind regards,
    Oleksii Sapov-Erlinger
    Radu
    Posts: 9018
    Joined: Fri Jul 09, 2004 5:18 pm

    Re: Define/add new entities in Entities window

    Post by Radu »

    Hi Oleksii,

    This is a very old forum thread, also your problem does not seem very related to it, maybe it would have been better to start a new forum thread for it.
    About this remark:
    Also I noticed a bug: when I update the .dtd file the are problems with updating the entities references in the xml
    We have various validation caches in place, when working on the DTDs, if you g back to the XML using the toolbar "Validate" action should be enough to reset all these caches.
    I do not understand why you want to add the DTD (which probably contains only some named entities) to the validation scenario. Of course once you add it there Oxygen will use it for validation and probably report errors because the DTD does not define any element inside it.

    Regards,
    Radu
    Radu Coravu
    <oXygen/> XML Editor
    http://www.oxygenxml.com
    Post Reply