Insert xml element with text value

Post here questions and problems related to oXygen frameworks/document types.
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Insert xml element with text value

Post by Isabelle »

Hello,

We use oxygen sdk 25.0.0.0.

We have this element in the xsd :

Code: Select all

<xs:complexType mixed="true" name="simplePara">
        <xs:attribute ref="id"/>
    </xs:complexType>
We want to set the element value to FULL when element is inserted.

I tried to use the content completion configuration file with this value :

Code: Select all

  <valueProposals path="/exportRegistrationStmt/simplePara">
    <items>
      <item value="full"/>
    </items>
  </valueProposals>
But it does not work.

Is there an equivalent of

Code: Select all

  <elementProposals path="exportRegistrationStmt" insertElements="simplePara">
    <insertAttribute name="exportRole" value="full"/>
  </elementProposals>
If no, how can I add text value to simplePara element when inserted.

Thanks,
Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Insert xml element with text value

Post by Radu »

Hi Isabelle,
We have an issue registered for imposing text element values using cc_config, I added your details to it and if it will get resolved in the future we will notify you on this thread. Pasting the issue ID for future reference:
EXM-47033 Impose default text value via the cc_config.xml
For now you will need to find other means to do this, maybe with a custom AuthorDocumentFilter implementation or by replacing the element in the content completion window with a custom action:
https://blog.oxygenxml.com/topics/custo ... etion.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply