[jboss-svn-commits] JBL Code SVN: r30207 - in labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources: xsl and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Nov 18 13:28:51 EST 2009


Author: whitingjr
Date: 2009-11-18 13:28:50 -0500 (Wed, 18 Nov 2009)
New Revision: 30207

Added:
   labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/
   labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/basedata.xsl
Log:
Updated to support deleting of constraints and adding again.


Added: labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/basedata.xsl
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/basedata.xsl	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/basedata.xsl	2009-11-18 18:28:50 UTC (rev 30207)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+   <xsl:template match="@*|node()">
+      <xsl:copy>
+         <xsl:apply-templates select="@*|node()" />
+      </xsl:copy>
+   </xsl:template>
+
+   <xsl:template match="node()">
+
+      <xsl:choose>
+         <xsl:when test="comment()">
+         </xsl:when>
+         <xsl:when test="name()=''">
+            <!-- This captures empty content nodes -->
+         </xsl:when>
+         <xsl:when test="translate(name(.), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='comment'">
+               <xsl:element name="{name()}_T">
+               <xsl:for-each select="@*">
+                    <xsl:apply-templates select="."/>
+                </xsl:for-each>
+            </xsl:element>
+         </xsl:when>
+         <xsl:otherwise>
+            <!-- xsl:element
+               name="{translate(name(.), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')}"-->
+            <xsl:element name="{name()}">
+               <xsl:for-each select="@*">
+                    <xsl:apply-templates select="."/>
+                </xsl:for-each>
+               <xsl:apply-templates />
+            </xsl:element>
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:template>
+
+   <xsl:template match="@*">
+     <xsl:choose>
+        <xsl:when test="translate(name(.), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='password'">
+            <xsl:attribute
+                  name="{name()}_C">
+             <xsl:value-of select="." />
+          </xsl:attribute>
+        </xsl:when>
+        <xsl:otherwise>
+			  <xsl:attribute name="{name()}">
+	          <xsl:value-of select="." />
+	       </xsl:attribute>
+        </xsl:otherwise>
+     </xsl:choose>
+      
+   </xsl:template>
+
+</xsl:stylesheet>



More information about the jboss-svn-commits mailing list