Information about content completion

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

Information about content completion

Post by Isabelle »

Hello,
We use oxygen sdk 25.0.0.0.
In our xsd we have this :

Code: Select all

    <xs:element name="procedure" type="procedureElemType"/>
    <xs:complexType name="procedureElemType">
        <xs:sequence>
            <xs:element ref="mainProcedure"/>
        </xs:sequence>
    </xs:complexType>    
    <xs:element name="mainProcedure" type="mainProcedureElemType"/>
<xs:complexType name="mainProcedureElemType">
        <xs:choice maxOccurs="unbounded">
            <xs:choice>
                <xs:element ref="proceduralStep"/>
                <xs:element ref="proceduralStepAlts"/>
            </xs:choice>
        </xs:choice>
        <xs:attribute ref="id"/>
</xs:complexType>
<xs:element name="proceduralStep" type="proceduralStepElemType"/>
    <xs:complexType name="proceduralStepElemType">
        <xs:sequence>
            <xs:choice>
                <xs:sequence>
                    <xs:element ref="title"/>
                    <xs:element ref="warning"/>
                    <xs:choice maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="para"/>
                        <xs:element ref="figure"/>
                        <xs:element ref="caption"/>
                    </xs:choice>
                </xs:sequence>
                <xs:sequence>
                    <xs:element ref="warning"/>
                    <xs:choice maxOccurs="unbounded">
                        <xs:element ref="para"/>
                        <xs:element ref="figure"/>
                        <xs:element ref="caption"/>
                    </xs:choice>
                </xs:sequence>
            </xs:choice>
            <xs:choice maxOccurs="unbounded" minOccurs="0">
                <xs:element ref="proceduralStep"/>
                <xs:element ref="proceduralStepAlts"/>
            </xs:choice>
        </xs:sequence>
        <xs:attribute ref="id"/>
    </xs:complexType>
    <xs:element name="proceduralStepAlts" type="proceduralStepAltsElemType"/>
    <xs:complexType name="proceduralStepAltsElemType">
        <xs:sequence>
            <xs:element maxOccurs="unbounded" ref="proceduralStep"/>
        </xs:sequence>
        <xs:attribute ref="id"/>
    </xs:complexType>
In our xml document we want to force the content completion to add title only on first level proceduralStep (juste after mainProcedure) and add para in the next level of proceduralStep.
Like this :

Code: Select all

<procedure>
	<mainProcedure>
            <proceduralStep id="stp-001">
               <title/>
               <proceduralStep id="stp-001-001">
                  <para/>
                  <proceduralStep id="stp-001-001-001">
                     <para/>
                     <proceduralStep id="stp-001-001-001-001">
                        <para/>
                     </proceduralStep>
                  </proceduralStep>
               </proceduralStep>
               <proceduralStep id="stp-001-002">
                  <para/>
               </proceduralStep>
            </proceduralStep>
            <proceduralStep id="stp-002">
               <title/>
            </proceduralStep>
            <proceduralStep id="stp-003">
               <title/>
               <proceduralStep id="stp-003-001">
                  <para/>
                  <proceduralStep id="stp-003-001-001">
                     <para/>
                     <proceduralStep id="stp-003-001-001-001">
                        <para/>
                     </proceduralStep>
                  </proceduralStep>
               </proceduralStep>
            </proceduralStep>
         </mainProcedure>
</procedure>
To do this, we have added this in our cc_config.xml file

Code: Select all

  <elementProposals rejectElements="title" path="mainProcedure/proceduralStep//proceduralStep" />
  <elementProposals rejectElements="para" path="mainProcedure/proceduralStep" />
  <elementProposals insertElements="para" path="mainProcedure/proceduralStep//proceduralStep" />
  <elementProposals insertElements="title" path="mainProcedure/proceduralStep"/>
but it does not work, it alternates between title and para like this :

Code: Select all

<procedure>
         <mainProcedure>
            <proceduralStep id="stp-001">
               <title/>
               <proceduralStep id="stp-001-001">
                  <para/>
                  <proceduralStep id="stp-001-001-001">
                     <title/>
                     <proceduralStep id="stp-001-001-001-001">
                        <para/>
                     </proceduralStep>
                  </proceduralStep>
                  <proceduralStep id="stp-001-001-002">
                     <title/>
                     <proceduralStep id="stp-001-001-002-001">
                        <para/>
                        <proceduralStep id="stp-001-001-002-001-001">
                           <title/>
                        </proceduralStep>
                     </proceduralStep>
                  </proceduralStep>
                  <proceduralStep id="stp-001-001-003">
                     <title/>
                     <proceduralStep id="stp-001-001-003-001">
                        <para/>
                     </proceduralStep>
                     <proceduralStep id="stp-001-001-003-002">
                        <para/>
                     </proceduralStep>
                  </proceduralStep>
               </proceduralStep>
            </proceduralStep>
         </mainProcedure>
</procedure>
Is it possible to do what we want ?
If yes, what is the good path to add ?

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

Re: Information about content completion

Post by Radu »

Hi Isabelle,
I added an internal issue to see if we can find the time to investigate the problem. In general when the cc_config.xml is not enough you need to use some java code, our schema manager filter API for example.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Isabelle
Posts: 155
Joined: Fri Jan 20, 2017 1:11 pm

Re: Information about content completion

Post by Isabelle »

Hello Radu,
Can we have a status on this issues ?
Thanks,
Regards.
Isabelle
Radu
Posts: 9273
Joined: Fri Jul 09, 2004 5:18 pm

Re: Information about content completion

Post by Radu »

Hi Isabelle,

For future reference the ID of the internal issue is:
EXM-54530 Problems with element proposals computation

I'm sorry but we have not had the time to look into or analyze it. So I do not have a fix timeline. I will update this forum thread if we manage to make any progress on this.

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