Changeset 1772


Ignore:
Timestamp:
02/24/12 14:42:25 (12 years ago)
Author:
twagoo
Message:

Made comp2schema.xsl compatible with current versions of Saxon-HE by removing
saxon:indent-spaces and saxon:next-in-chain attributes, which are propietary Saxon extensions.
By default, the resulting XSD will no longer have pretty indentation (which could even be
beneficial to the performance!).

(Note that the current version of the ComponentRegistry however sets these parameters anyway, which is ok since it uses Saxon-B.)

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

Legend:

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

    • Property svn:keywords
      •  

        old new  
        11Date
         2Rev
    r1167 r1772  
    22
    33<!--
    4     $Rev: 484 $
     4    $Rev$
    55    $Date$
    66-->
     
    1010    xmlns:ann="http://www.clarin.eu">
    1111    <xsl:strip-space elements="*"/>
    12     <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" saxon:indent-spaces="1"
    13         xmlns:saxon="http://saxon.sf.net/"/>
     12    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" />
    1413
    15     <xsl:template match="/xs:schema">
     14    <xsl:template match="/xs:schema" mode="clean">
    1615        <xs:schema xmlns:cmd="http://www.clarin.eu/cmd/">
    1716            <xsl:copy-of select="@*"/>
    18             <xsl:apply-templates select="xs:import"/>
     17            <xsl:apply-templates select="xs:import" mode="clean"/>
    1918            <!-- Remove double entries for named simpleType and complexType definitions at the begin of the XSD.  -->
    2019            <xsl:for-each-group select="./xs:simpleType" group-by="@name">
     
    2827            </xsl:for-each-group>
    2928
    30             <xsl:apply-templates select="xs:element"/>
     29            <xsl:apply-templates select="xs:element" mode="clean"/>
    3130        </xs:schema>
    3231    </xsl:template>
     
    3433
    3534    <!-- identity copy -->
    36     <xsl:template match="@*|node()">
     35    <xsl:template match="@*|node()" mode="clean">
    3736        <xsl:copy>
    38             <xsl:apply-templates select="@*|node()"/>
     37            <xsl:apply-templates select="@*|node()" mode="clean"/>
    3938        </xsl:copy>
    4039    </xsl:template>
  • metadata/trunk/toolkit/xslt/comp2schema-v2/comp2schema.xsl

    r1744 r1772  
    1414    <xsl:strip-space elements="*"/>
    1515    <xsl:include href="comp2schema-header.xsl"/>
     16    <xsl:include href="cleanup-xsd.xsl"/>
    1617    <!-- note: the automatic chaining with clean-xsd.xsl only works with the Saxon XSLT processor, otherwise you'll have to do this manually (or use e.g the Xalan pipeDocument tag) -->
    17     <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" saxon:indent-spaces="1"
    18         saxon:next-in-chain="cleanup-xsd.xsl" xmlns:saxon="http://saxon.sf.net/"/>
     18    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" />
    1919
    2020    <!-- Start includes -->
     
    5151        </xsl:variable>
    5252        <!-- Process the complete tree -->
    53         <xsl:apply-templates select="$tree/*"/>
     53        <xsl:variable name="schema">
     54            <xsl:apply-templates select="$tree/*"/>
     55        </xsl:variable>
     56        <xsl:apply-templates select="$schema" mode="clean" />
    5457    </xsl:template>
    5558
     
    430433        </xsl:if>
    431434    </xsl:template>
    432 
     435   
    433436</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.