Page 1 of 1

Unable to insert valid Element in Author Mode

Posted: Thu Nov 12, 2020 7:56 am
by fsteimke
Hi,
i have a Relax NG Schema for simple XML Documents (compact Syntax). It includes an optional sequence of two elements called laenge and fixed-length, so that either they have to appear both or none of them. The relevant part of the schema looks like this:

Code: Select all

element db:ist-hinweis { xsd:boolean },
(element db:laenge { xsd:positiveInteger },
element db:fixed-length { xsd:boolean })?,
element db:haeufigkeit { text },


When i edit valid document instances without both laenge and fixed length elements in author mode, i am unable to insert these elements afterwards. When i select the ist-hinweis Element in the outline view and try to Insert after ..., the laenge Element is grayed out, and the message is the The Element is not valid at cursor position. The same happens when i select the haeufigkeit Eltemtn and try to Insert before ...

So i am forced to switch to the text view instead. Insert both Elements between ist-hinweis and haeufigkeit is no Problem in Text mode.

Sincerely, Frank

Re: Unable to insert valid Element in Author Mode

Posted: Thu Nov 12, 2020 3:59 pm
by Radu
Hi Frank,

Thanks for the feedback.
Would it be possible for you to come up with a small sample XML document and a full RNC schema exemplifying the problem?
As far as I know for the Author visual editing mode when showing the content completion window we take into account also the list of elements which follow the caret position, and maybe there is a problem on our side when doing so. For the Text editing mode we only take into account the list of previous sibling elements when invoking the content completion window.

Regards,
Radu

Re: Unable to insert valid Element in Author Mode

Posted: Fri Nov 13, 2020 3:22 pm
by fsteimke
Hi Radu,

sure. I see that i have not mentioned the fact that my RNC Schema includes a DocBook Schema. Here ist is:

Code: Select all

namespace db = "http://docbook.org/ns/docbook"

include "http://www.oasis-open.org/docbook/xml/5.1/rng/docbookxi.rnc" {
    start = db.book | db.dsmeld-groups | db.dsmeld-group | db.dsmeld-blatt
}
# Überall dort, wo eine Tabelle stehen darf, darf auch das Element dsmeld-toc stehen.
# Es wird durch eine Tabelle mit dem Inhaltsverzeichnis aller DSMeld Blätter ersetzt
db.table.choice |= element db:dsmeld-toc { empty }
# Überall dort, wo eine Tabelle stehen darf, darf auch das Element dsmeld-groups stehen.
# Es wird durch eine Sequenz von Tabellen ersetzt
db.table.choice |= db.dsmeld-groups
# dsmeld-groups enthält eine Sequenz von dsmeld-group Elementen
db.dsmeld-groups =
    element db:dsmeld-groups {
        db.version.attribute?, db.xml.lang.attribute?, db.xml.base.attribute?, db.dsmeld-group+
    }
# dsmeld-group enthält eine Sequenz von dsmeld-blatt Elementen
db.dsmeld-group =
    element db:dsmeld-group {
        attribute bmg { text }?,
        element db:title { xsd:token },
        db.dsmeld-blatt+
    }
# Ein dsmeld-blatt gemäß Design der DSMeld Gruppe
db.dsmeld-blatt =
    element db:dsmeld-blatt {
        db.xml.base.attribute?,
        db.xml.lang.attribute?,
        db.xml.id.attribute,
        element db:blatt { text },
        element db:feldbezeichnung { text },
        element db:stand { text },
        element db:bmg-bezug { text },
        element db:ist-hinweis { xsd:boolean },
        db.feldlaenge,
        element db:haeufigkeit { text },
        element db:inhalt { db.dsmeld.blocks },
        element db:numerisch { db.dsmeld.blocks? }?,
        element db:alphanumerisch { db.dsmeld.blocks? }?,
        db.darstellungsform,
        element db:codeliste { db.xlink.href.attribute?, text }?
    }
# Eine optionale Sequenz von zwei Elementen zur Feldlänge.
# Fehlt diese Sequenz, dann ist das gleichbedeutend mit "offen" (= ohne Begrenzung der Länge)
db.feldlaenge =
    (element db:laenge { xsd:positiveInteger },
     element db:fixed-length { xsd:boolean })?
# Eine optionale Angabe zur Darstellungsform.
# Fehlt dieses Element, dann ist das gleichbedeutend mit "Unverschlüsselt"     
db.darstellungsform = element db:darstellungsform { db.dsmeld.blocks }?
# Der zulässige Inhalt der Textfelder eines DSMeld-Blattes ist stark eingeschränkt
db.dsmeld.blocks = (db.simpara | db.para | db.itemizedlist | db.orderedlist | db.literallayout)+
And this is my Document, vaild with respect to the Schema given:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<db:dsmeld-blatt xml:id="dsmeld.blatt.0301" xmlns:db="http://docbook.org/ns/docbook">
    <db:blatt>0301</db:blatt>
    <db:feldbezeichnung>Vornamen</db:feldbezeichnung>
    <db:stand>1. November 2015</db:stand>
    <db:bmg-bezug>§ 3 Abs. 1 Nr. 3</db:bmg-bezug>
    <db:ist-hinweis>false</db:ist-hinweis>
    <db:haeufigkeit>einfach</db:haeufigkeit>
    <db:inhalt>
        <db:simpara>Es sind sämtliche Vornamen in der Reihenfolge anzugeben, wie sie in einer deutschen Personenstandsurkunde eingetragen sind. </db:simpara>
        <db:simpara>Bei Ausländern, die keine deutsche Personenstandsurkunde vorlegen können, ist die Eintragung im Pass maßgebend; eine anderslautende Schreibweise in einer der Meldebehörde vorliegenden ausländischen Personenstandsurkunde tritt grundsätzlich zurück.</db:simpara>
        <db:simpara>Fehlt der Vorname zu Recht, so ist in der ersten Stelle ein <db:quote>+</db:quote> anzugeben; dies gilt auch für Blocknamen (siehe Blatt 0101).</db:simpara>
        <db:simpara>Ist bis zum Inkrafttreten des BMG am 1. November 2015 in der 60. Stelle als Merkmal ein <db:quote>.</db:quote> (Punkt) angegeben, ist der Eintrag spätestens bei der Beantragung eines Ausweisdokuments zu ändern. Bei ausländischen Personen erfolgt die Änderung nach der Vorlage des Identitätsdokumentes.</db:simpara>
    </db:inhalt>
    <db:alphanumerisch>
        <db:itemizedlist>
            <db:listitem>
                <db:simpara>alle Zeichen</db:simpara>
            </db:listitem>
            <db:listitem>
                <db:simpara>nur in der ersten Stelle zugelassen +</db:simpara>
            </db:listitem>
            <db:listitem>
                <db:simpara>nur in der 60. Stelle zugelassen . für Eintragungen bis 31. Oktober 2015</db:simpara>
            </db:listitem>
            <db:listitem>
                <db:simpara>in der ersten Stelle nicht zugelassen -</db:simpara>
            </db:listitem>
        </db:itemizedlist>
    </db:alphanumerisch>
    <db:darstellungsform>
        <db:simpara>unverschlüsselt</db:simpara>
        <db:simpara>Die Vornamen sind jeweils durch ein Leerzeichen zu trennen. </db:simpara>
        <db:simpara>Mit einem Bindestrich verbundene Vornamen sind ein Vorname.</db:simpara>
    </db:darstellungsform>
</db:dsmeld-blatt>
The Issue happens when I select ist-hinweis in Outline View (Author Mode) and try to "insert after", or haeufigkeit and "Instert before".

Thank,
Frank

Re: Unable to insert valid Element in Author Mode

Posted: Mon Nov 16, 2020 4:04 pm
by Radu
Hi Frank,

Thanks for the sample, I can now reproduce the problem on our side and I added an issue to look into it.
We plan to release Oxygen 23.0 in a couple of days and in Oxygen 23 in the Preferences->"Editor / Content Completion" page there will be a new setting named "Consider subsequent sibling elements" which when unchecked will make the content completion work correctly both in the Text and the Author visual editing modes. But if we manage to fix the issue that I added maybe in a future Oxygen 23.x release we'll make this work correctly with the default content completion settings. I will update this forum thread when we fix this problem on our side.

Regards,
Radu