Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-dev] Nesting of same element in extension point schema

Mitra,

You probably want a schema like the following :

<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="sandbox" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
      <appinfo>
         <meta.schema plugin="sandbox" id="nested" name="nested"/>
      </appinfo>
      <documentation>
         [Enter description of this extension point.]
      </documentation>
   </annotation>

   <element name="extension">
      <annotation>
         <appinfo>
            <meta.element />
         </appinfo>
      </annotation>
      <complexType>
         <sequence minOccurs="0" maxOccurs="unbounded">
            <element ref="component"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                 
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                 
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                 
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="component">
      <complexType>
         <sequence minOccurs="0" maxOccurs="unbounded">
            <element ref="component"/>
         </sequence>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                 
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appinfo>
         <meta.section type="since"/>
      </appinfo>
      <documentation>
         [Enter the first release in which this extension point appears.]
      </documentation>
   </annotation>

   <annotation>
      <appinfo>
         <meta.section type="examples"/>
      </appinfo>
      <documentation>
         [Enter extension point usage example here.]
      </documentation>
   </annotation>

   <annotation>
      <appinfo>
         <meta.section type="apiinfo"/>
      </appinfo>
      <documentation>
         [Enter API information here.]
      </documentation>
   </annotation>

   <annotation>
      <appinfo>
         <meta.section type="implementation"/>
      </appinfo>
      <documentation>
         [Enter information about supplied implementation of this extension point.]
      </documentation>
   </annotation>


</schema>


To summarize, <extension> has a sequence of 0-n <component>,a  <component> also having a sequence of 0-n <component>...

Cheers,
Benjamin
Anyware Technologies
Benjamin Cabé
Expert Eclipse
benjamin.cabe@xxxxxxxxxxxxxxxx
http://blog.benjamin-cabe.com
Tel : +33(0)5 61 00 06 41
Fax : +33(0)5 61 00 51 46
 
Nouvelle adresse

Anyware Technologies
Lake Park
ZAC de l'Hers - Allée du Lac
BP 87216
31672 Labège Cedex
France
www.anyware-tech.com


Mitra, Priyanka a écrit :
Nesting of same element in extension point schema

Hi,

I want to nest the same element in the extension point schema. Is this possible? I tried a few things but didn’t work. So I defined a new element "component" using the extension point editor on PDE. Under "extension" node, I defined a sequence of "component" element (1-*). Within this sequence I created another new sequence of "component" element (1-*) and then defined another new sequence within the last sequence comprising of "component" element (1-*).   But I didn’t get the desired result. The extenion point had 3 components at the root level rather than nested. I also played around with "choice" but with no luck.

 To give you an example..

<component>
  <attr1><attr1>
  <attr2><attr2>
  <attr3><attr3>
          <component> <!-- optional -->
                    <attr1><attr1>
                    <attr2><attr2>
                    <attr3><attr3>
                                 <component> <!-- optional -->
                                        <attr1><attr1>
                                       <attr2><attr2>
                                       <attr3><attr3>
                                <component>
         <component>
<component>

Has anyone tried this kind of nesting? I appreciate all your help.

Thanx & Regards
Priyanka


_______________________________________________ pde-dev mailing list pde-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/pde-dev

Back to the top