You are viewing a plain text version of this content. The canonical link for it is here.
Posted to alexandria-dev@jakarta.apache.org by ru...@apache.org on 2001/04/12 00:12:25 UTC
cvs commit: jakarta-alexandria/proposal/gump/stylesheet merge.xsl
rubys 01/04/11 15:12:24
Modified: proposal/gump rubix.xml rubypad.xml
proposal/gump/stylesheet merge.xsl
Log:
Merge in merge.xsl changes from alexandria.
WARNING: this will require version attributes on workspace definitions.
Beyond that, it only enables repository href's...unexploited at this point.
Revision Changes Path
1.29 +2 -1 jakarta-alexandria/proposal/gump/rubix.xml
Index: rubix.xml
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/rubix.xml,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- rubix.xml 2001/04/10 00:17:17 1.28
+++ rubix.xml 2001/04/11 22:12:21 1.29
@@ -1,4 +1,5 @@
-<workspace basedir="/home/rubys/jakarta" cvsdir="/home/rubys/jakarta/cvs">
+<workspace basedir="/home/rubys/jakarta" cvsdir="/home/rubys/jakarta/cvs"
+ version="0.2">
<build sysclasspath="only"/>
1.29 +1 -1 jakarta-alexandria/proposal/gump/rubypad.xml
Index: rubypad.xml
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/rubypad.xml,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- rubypad.xml 2001/04/10 00:17:18 1.28
+++ rubypad.xml 2001/04/11 22:12:22 1.29
@@ -1,4 +1,4 @@
-<workspace basedir="D:\jakarta" cvsdir="D:\jakarta\cvs">
+<workspace basedir="D:\jakarta" cvsdir="D:\jakarta\cvs" version="0.2">
<build sysclasspath="only"/>
1.6 +43 -2 jakarta-alexandria/proposal/gump/stylesheet/merge.xsl
Index: merge.xsl
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/stylesheet/merge.xsl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- merge.xsl 2001/04/04 20:22:57 1.5
+++ merge.xsl 2001/04/11 22:12:23 1.6
@@ -4,7 +4,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
+ <xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*|@*">
@@ -18,6 +18,17 @@
<!-- =================================================================== -->
<xsl:template match="workspace">
+ <xsl:variable name="version">0.2</xsl:variable>
+ <xsl:if test="not(@version)">
+ <xsl:message terminate="yes">
+Cannot find version number, should be <workspace version="<xsl:value-of select="$version"/>">
+ </xsl:message>
+ </xsl:if>
+ <xsl:if test="not(@version=$version)">
+ <xsl:message terminate="yes">
+Hmm, looks like the wrong version <xsl:value-of select="@version"/>, expecting <xsl:value-of select="$version"/>
+ </xsl:message>
+ </xsl:if>
<xsl:variable name="basedir" select="@basedir"/>
<xsl:copy>
@@ -51,8 +62,10 @@
</xsl:if>
<xsl:copy-of select="@*"/>
- <xsl:copy-of select="*[not(self::project)]"/>
+ <!-- Drop pre-processing versions of project and repository -->
+ <xsl:copy-of select="*[not(self::project|self::repository)]"/>
+
<!-- process any directly nested projects verbatim -->
<xsl:for-each select="project[not(@href)]">
@@ -82,16 +95,39 @@
<xsl:variable name="defined-in"
select="substring-before(substring-after(@href,'/'),'.')"/>
+ <xsl:variable name="tag" select="@tag"/>
<xsl:for-each select="$file/project">
<xsl:call-template name="project">
<xsl:with-param name="home" select="$home"/>
<xsl:with-param name="basedir" select="$basedir"/>
+ <xsl:with-param name="tag" select="$tag"/>
<xsl:with-param name="defined-in" select="$defined-in"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
+ <!-- Process repositories -->
+ <xsl:for-each select="repository[@href]">
+ <xsl:text> </xsl:text>
+
+ <!-- is the file found? -->
+
+ <xsl:variable name="file" select="document(@href,.)"/>
+ <xsl:if test="not($file/repository)">
+ <xsl:message terminate="yes">
+ <xsl:text>Unable to open </xsl:text>
+ <xsl:value-of select="@href"/>
+ </xsl:message>
+ </xsl:if>
+
+ <!-- process it -->
+
+ <xsl:copy-of select="$file[not(self::home|self::project)] |@*| text()"/>
+
+
+ </xsl:for-each>
+
</xsl:copy>
</xsl:template>
@@ -102,6 +138,7 @@
<xsl:template name="project">
<xsl:param name="home"/>
<xsl:param name="basedir"/>
+ <xsl:param name="tag"/>
<xsl:param name="defined-in"/>
<xsl:variable name="project" select="@name"/>
@@ -136,6 +173,10 @@
<xsl:attribute name="srcdir">
<xsl:value-of select="$srcdir"/>
+ </xsl:attribute>
+
+ <xsl:attribute name="tag">
+ <xsl:value-of select="$tag"/>
</xsl:attribute>
<xsl:apply-templates select="*[not(self::home|self::project)] | text()"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: alexandria-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: alexandria-dev-help@jakarta.apache.org