Partager via


Élément de construction du schéma GDL

Le schéma XSD produit par l’analyseur GDL définit un élément de construction comme suit :

    <complexType name="GDL_ConstructType">
        <sequence>
            <any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="Name" type="string" use="required"/>
        <attribute name="Instance" type="string" use="required"/>
        <attribute name="Constrained" type="boolean" use="optional"/>
    </complexType>

La définition précédente est similaire à la définition de l’élément< SnapshotRoot>. Et les éléments de construction, comme l’élément racine, peuvent contenir des éléments construct (<CONSTRUCT>) et d’attribut (<GDL_ATTRIBUTE>). However, <GDL_ConstructType> can have three additional XML attributes: Name, Instance, and Constrained. Name and Instance and required and hold the Name and Instance GDL constructs, respectively. Constrained is optional and holds a Boolean value that indicates if the option is constrained or not. Cet attribut s’affiche uniquement pour les <éléments CONSTRUCT> qui correspondent aux constructions *Option.

Par exemple, considérez l’entrée GDL suivante.

*Feature:  PaperSize
{
   *Option:  Letter
   {
   }
}

L’entrée précédente génère l’instantané XML suivant.

     <CONSTRUCT Name="*Feature" Instance="PaperSize">
        <CONSTRUCT Name="*Option" Instance="Letter" Constrained="FALSE" >
        </CONSTRUCT>
    </CONSTRUCT>

Une option particulière est marquée contrainte en fonction de la configuration fournie et de l’ensemble de contraintes définies dans les données d’instance GDL.