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/09/28 07:28:42 UTC
cvs commit: jakarta-alexandria/proposal/gump/stylesheet build.xsl defaults.xsl
rubys 01/09/27 22:28:42
Modified: proposal/gump gen.java
proposal/gump/project ldap.xml
proposal/gump/stylesheet build.xsl defaults.xsl
Log:
Simplification/cleanup. Move more logic from XSLT to Java.
Revision Changes Path
1.14 +17 -8 jakarta-alexandria/proposal/gump/gen.java
Index: gen.java
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/gen.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- gen.java 2001/09/19 02:28:43 1.13
+++ gen.java 2001/09/28 05:28:41 1.14
@@ -186,12 +186,6 @@
definedIn = parent.getAttribute("name");
element.setAttribute("defined-in",definedIn);
- if (parent.getNodeName().equals("module")) {
- if (element.getAttributeNode("module") == null) {
- element.setAttribute("module",parent.getAttribute("name"));
- }
- }
-
parent.removeChild(element);
root.appendChild(element);
}
@@ -251,9 +245,24 @@
Hashtable modules = flatten("module", workspace);
for (Enumeration e=modules.keys(); e.hasMoreElements();) {
Element module = (Element)modules.get(e.nextElement());
+ String name = module.getAttribute("name");
+
+ // compute source directory
String srcdir=module.getAttribute("srcdir");
- if (srcdir.equals("")) srcdir=module.getAttribute("name");
+ if (srcdir.equals("")) srcdir=name;
module.setAttribute("srcdir", basedir + "/" + srcdir);
+
+ // set module name on any projects contained herein
+ Node child=module.getFirstChild();
+ while (child != null) {
+ if (child.getNodeName().equals("project")) {
+ Element project = (Element) child;
+ if (project.getAttributeNode("module") == null) {
+ project.setAttribute("module", name);
+ }
+ }
+ child=child.getNextSibling();
+ }
}
}
@@ -304,10 +313,10 @@
workspaceDefaults(workspace);
expand((Element)workspace);
+ computeSrcdir((Element) workspace);
flatten("project", workspace);
flatten("repository", workspace);
antDependsToProperties(doc);
- computeSrcdir((Element) workspace);
Node resolved = transform(doc, "defaults.xsl");
output (resolved, "work/merge.xml");
1.2 +1 -1 jakarta-alexandria/proposal/gump/project/ldap.xml
Index: ldap.xml
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/project/ldap.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ldap.xml 2001/09/16 14:38:04 1.1
+++ ldap.xml 2001/09/28 05:28:41 1.2
@@ -1,4 +1,4 @@
-<module name="jndi">
+<module name="ldap">
<url href="http://java.sun.com/products/jndi/"/>
<description>
1.30 +6 -3 jakarta-alexandria/proposal/gump/stylesheet/build.xsl
Index: build.xsl
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/stylesheet/build.xsl,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- build.xsl 2001/09/20 21:20:31 1.29
+++ build.xsl 2001/09/28 05:28:42 1.30
@@ -156,9 +156,12 @@
</a>
</xsl:when>
<xsl:otherwise>
- <a href="module_{@module}.html">
- <xsl:value-of select="$dependent"/>
- </a>
+ <xsl:variable name="module" select="@module"/>
+ <xsl:for-each select="/workspace/module[@name=$module]">
+ <a href="module_{@defined-in}.html">
+ <xsl:value-of select="$dependent"/>
+ </a>
+ </xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
1.13 +3 -23 jakarta-alexandria/proposal/gump/stylesheet/defaults.xsl
Index: defaults.xsl
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/stylesheet/defaults.xsl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- defaults.xsl 2001/09/19 13:11:46 1.12
+++ defaults.xsl 2001/09/28 05:28:42 1.13
@@ -16,35 +16,15 @@
<xsl:template match="project">
- <xsl:variable name="basedir" select="../@basedir"/>
<xsl:variable name="project" select="@name"/>
<!-- determine the name of the module -->
- <xsl:variable name="module">
- <xsl:choose>
- <xsl:when test="@module">
- <xsl:value-of select="@module"/>
- </xsl:when>
- <xsl:when test="@defined-in">
- <xsl:value-of select="@defined-in"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
+ <xsl:variable name="module" select="@module"/>
<xsl:variable name="srcdir" select="../module[@name=$module]/@srcdir"/>
<xsl:copy>
- <xsl:apply-templates select="@*[name()!='module']"/>
-
- <xsl:attribute name="module">
- <xsl:value-of select="$module"/>
- </xsl:attribute>
-
- <xsl:apply-templates select="*[not(self::home)] | text()"/>
+ <xsl:apply-templates select="@* | *[not(self::home)] | text()"/>
<!-- Compute fully qualified home directory -->
@@ -54,7 +34,7 @@
<xsl:value-of select="@home"/>
</xsl:when>
<xsl:when test="home/@parent">
- <xsl:value-of select="$basedir"/>
+ <xsl:value-of select="../@basedir"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="home/@parent"/>
</xsl:when>
---------------------------------------------------------------------
To unsubscribe, e-mail: alexandria-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: alexandria-dev-help@jakarta.apache.org