Changeset 297


Ignore:
Timestamp:
03/26/10 16:29:38 (14 years ago)
Author:
dietuyt
Message:

Addition of Documentation attribute to CMD_Element (transformed into
<xs:documentation> tag in XSD)

Location:
metadata/trunk/toolkit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • metadata/trunk/toolkit/comp2schema.xsl

    r81 r297  
    186186    <!-- Process all CMD_Elements, its attributes and children -->
    187187    <xsl:template match="CMD_Element">
     188       
     189       
    188190        <xsl:choose>
    189191
     
    191193            <xsl:when test="./AttributeList and ./ValueScheme">
    192194                <xs:element name="{@name}">
     195                    <xsl:apply-templates select= "@Documentation"/>
    193196                    <xsl:apply-templates select="./ValueScheme"/>
    194197                </xs:element>
     
    198201            <xsl:when test="./AttributeList and not(./ValueScheme)">
    199202                <xs:element name="{@name}">
     203                    <xsl:apply-templates select= "@Documentation"/>
    200204                    <xsl:apply-templates select= "@ConceptLink"/>
    201205                    <xsl:apply-templates select= "@CardinalityMin"/>
     
    215219            <xsl:otherwise>
    216220                <xsl:element name="xs:element">
     221                    <xsl:apply-templates select= "@Documentation"/>
    217222                    <xsl:apply-templates select="@* | node()"/>
    218223                </xsl:element>
     
    308313    </xsl:template>
    309314
     315    <xsl:template match="@Documentation">
     316        <xs:annotation>
     317            <xs:documentation><xsl:value-of select="."/></xs:documentation>
     318        </xs:annotation>
     319    </xsl:template>
     320
    310321    <xsl:template match="@ValueScheme">
    311322        <xsl:attribute name="type">
  • metadata/trunk/toolkit/example/example-component-actor.xml

    r47 r297  
    88    <CMD_Component name="Actor" CardinalityMin="0" CardinalityMax="unbounded" ComponentId="eu.clarin.mdcomponent.actor">
    99       
    10         <CMD_Element name="firstName" ValueScheme="string">
     10        <CMD_Element name="firstName" ValueScheme="string" Documentation="This is the firstname of a person">
    1111            <!-- provide a nickname attribute for the firstName element -->
    1212            <AttributeList>
  • metadata/trunk/toolkit/example/example-md-schema.xsd

    r72 r297  
    145145                        </xs:complexType>
    146146                     </xs:element>
     147                     <xs:element minOccurs="0" name="IsPartOfList">
     148                        <xs:complexType>
     149                           <xs:sequence>
     150                              <xs:element maxOccurs="unbounded" minOccurs="0" name="IsPartOf" type="xs:anyURI"/>
     151                           </xs:sequence>
     152                        </xs:complexType>
     153                     </xs:element>
    147154                  </xs:sequence>
    148155               </xs:complexType>
     
    189196                           <xs:sequence>
    190197                              <xs:element name="firstName">
     198                                 <xs:annotation>
     199                                    <xs:documentation>This is the firstname of a person</xs:documentation>
     200                                 </xs:annotation>
    191201                                 <xs:complexType>
    192202                                    <xs:simpleContent>
  • metadata/trunk/toolkit/general-component-schema.xsd

    r81 r297  
    9090        <xs:attribute name="CardinalityMin" type="cardinality_type"/>
    9191        <xs:attribute name="CardinalityMax" type="cardinality_type"/>
     92        <xs:attribute name="Documentation" type="xs:string"/>
    9293    </xs:attributeGroup>
    9394
Note: See TracChangeset for help on using the changeset viewer.