cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: cocoon-2.1/tools/src
Date Tue, 18 Nov 2003 18:08:55 GMT
joerg       2003/11/18 10:08:55

  Added:       tools/src
  initial import: generating from gump.xml
  Revision  Changes    Path
  1.1                  cocoon-2.1/tools/src/
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl=""
  <xsl:output method="text"/>
  <xsl:key name="status" match="project[starts-with(@name, 'cocoon-block-')]" use="@status"/>
  <xsl:key name="dependency" match="project[starts-with(@name, 'cocoon-block-')]/depend[starts-with(@project,
'cocoon-block-')]" use="@project"/>
  <desc:desc name="common">
  #                             Cocoon Blocks                                    #
  # Remove blocks from your cocoon distribution by uncommenting the
  # corresponding exclude property.
  # NOTE: Don't modify this file directly but make a copy named
  # '' and modify that. The build system will override
  # these properties with the ones in the '' file.
  # NOTE: "[dependency]" indicates blocks that are required by other blocks.
  # Disabling batik, for example, will result in a RuntimeException when using
  # fop. On the other hand some dependencies come only from the block samples.
  <desc:desc name="stable">
  # Stable blocks ----------------------------------------------------------------
  # Stable blocks are those that can be considered ready for production and
  # will contain components and API that will remain stable and where
  # developers are committed to back compatibility. In short, stuff that you
  # can depend on.
  <desc:desc name="unstable">
  # Unstable blocks --------------------------------------------------------------
  # Unstable blocks are currently under development and do not guarantee that the
  # contracts they expose (API, xml schema, properties, behavior) will remain
  # constant in time. Developers are not committed to back-compatibility just yet.
  # This doesn't necessarily mean the blocks implementation is unstable or
  # the code can't be trusted for production, but use with care and watch
  # its development as things might change over time before they are marked
  # stable.
  <desc:desc name="deprecated">
  # Deprecated blocks ------------------------------------------------------------
  # Although some of these blocks may have been stable, they are now deprecated
  # in favour of other blocks and therefore are excluded by default from the build
  <xsl:template match="/module">
  There are 2 issues this transformation does not handle at the moment:
  - The order of the @status sections, i.e. stable, unstable, deprecated.
    It depends on the first occurence of a block of one particular section.
  - Default exclude of a specific block. If a block is broken at any time
    and should be excluded, it must be done by hand afterwards.
  So before committing the updated please make a cvs diff
  to see what has really changed.
      <xsl:value-of select="document('')/xsl:stylesheet/desc:descs/desc:desc[@name = 'common']"/>
          select="project[starts-with(@name, 'cocoon-block-')]
                         [count(. | key('status', @status)[1]) = 1]"
  <xsl:template match="project" mode="group">
      <xsl:value-of select="document('')/xsl:stylesheet/desc:descs/desc:desc[@name = current()/@status]"/>
      <!-- unfortunately key('status', @status) does not work with sorting because of a
bug in Xalan: 24583 -->
      <xsl:apply-templates select="../project[starts-with(@name, 'cocoon-block-')][@status
= current()/@status]">
          <xsl:sort select="@name"/>
  <xsl:template match="project">
      <xsl:call-template name="dependency">
          <xsl:with-param name="elements" select="depend[starts-with(@project, 'cocoon-block-')]"/>
          <xsl:with-param name="text" select="'depends on'"/>
      <xsl:call-template name="dependency">
          <xsl:with-param name="elements" select="key('dependency', @name)/.."/>
          <xsl:with-param name="text" select="'is needed by'"/>
      <!-- TODO: make this configurable externally (dependent on @status or @name) -->
      <xsl:if test="@status != 'deprecated'">#</xsl:if>
      <xsl:value-of select="substring-after(@name, 'cocoon-block-')"/>
  <xsl:template name="dependency">
      <xsl:param name="elements" select="/.."/>
      <xsl:param name="text" select="''"/>
      <xsl:if test="$elements">
          <xsl:text>#-----[dependency]: "</xsl:text>
          <xsl:value-of select="substring-after(@name, 'cocoon-block-')"/>
          <xsl:text>" </xsl:text>
          <xsl:value-of select="$text"/>
          <xsl:apply-templates select="$elements" mode="dependency">
              <xsl:sort select="@name | @project"/>
  <xsl:template match="project | depend" mode="dependency">
      <xsl:text> "</xsl:text>
      <xsl:value-of select="substring-after(concat(@name, @project), 'cocoon-block-')"/>
          <xsl:when test="position() = last()">.&#10;</xsl:when>

View raw message