Changeset 2626


Ignore:
Timestamp:
02/26/13 07:55:17 (11 years ago)
Author:
twagoo
Message:

Modified comp2schema XSLT to include the component specification's <Header> element as an appInfo annotation to the resulting XSD.

Location:
metadata/trunk/toolkit/xslt/comp2schema-v2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • metadata/trunk/toolkit/xslt/comp2schema-v2/cleanup-xsd.xsl

    r1772 r2626  
    1515        <xs:schema xmlns:cmd="http://www.clarin.eu/cmd/">
    1616            <xsl:copy-of select="@*"/>
     17            <!-- Keep the annotation with header information -->
     18            <xsl:copy-of select="xs:annotation" />
    1719            <xsl:apply-templates select="xs:import" mode="clean"/>
    1820            <!-- Remove double entries for named simpleType and complexType definitions at the begin of the XSD.  -->
  • metadata/trunk/toolkit/xslt/comp2schema-v2/comp2schema.xsl

    r2311 r2626  
    6161
    6262        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dcr="http://www.isocat.org/ns/dcr" xmlns:cmd="http://www.clarin.eu/cmd/" targetNamespace="http://www.clarin.eu/cmd/" elementFormDefault="qualified">
    63 
     63           
     64            <!-- put the header information from the component specification in the schema as appinfo -->
     65            <xs:annotation>
     66                <xs:appinfo xmlns:ann="http://www.clarin.eu">
     67                    <xsl:apply-templates select="Header" mode="Header"/>
     68                </xs:appinfo>
     69            </xs:annotation>
     70           
    6471            <!-- import this for the use of the xml:lang attribute -->
    6572            <xs:import namespace="http://www.w3.org/XML/1998/namespace"
     
    7279            <!-- then create simple type for the ResourceProxy -->
    7380            <xsl:call-template name="PrintHeaderType"/>
    74 
     81           
    7582
    7683            <xs:element name="CMD">
     
    104111
    105112    </xsl:template>
    106 
     113   
     114    <xsl:template match="*" mode="Header">
     115        <xsl:element name="ann:{name()}" namespace="http://www.clarin.eu">
     116            <xsl:value-of select="text()"/>
     117            <xsl:apply-templates select="*" mode="Header" />
     118        </xsl:element>
     119    </xsl:template>
    107120
    108121    <xsl:template name="CreateComplexTypes">
Note: See TracChangeset for help on using the changeset viewer.