uima-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r1000889 - /uima/uima-as/trunk/uima-as-distr/src/main/scripts/dd2spring.xsl
Date Fri, 24 Sep 2010 14:44:20 GMT
Author: schor
Date: Fri Sep 24 14:44:20 2010
New Revision: 1000889

URL: http://svn.apache.org/viewvc?rev=1000889&view=rev
Log:
[UIMA-1885] allow placeholder names in more places

Modified:
    uima/uima-as/trunk/uima-as-distr/src/main/scripts/dd2spring.xsl

Modified: uima/uima-as/trunk/uima-as-distr/src/main/scripts/dd2spring.xsl
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uima-as-distr/src/main/scripts/dd2spring.xsl?rev=1000889&r1=1000888&r2=1000889&view=diff
==============================================================================
--- uima/uima-as/trunk/uima-as-distr/src/main/scripts/dd2spring.xsl (original)
+++ uima/uima-as/trunk/uima-as-distr/src/main/scripts/dd2spring.xsl Fri Sep 24 14:44:20 2010
@@ -2569,7 +2569,7 @@
     <xsl:message select="'end of nearest key'"/> -->
     <xsl:choose>
       <xsl:when test="$nearestKey">
-        <xsl:sequence select="string($nearestKey/@key)"/>
+        <xsl:sequence select="f:createValidName(string($nearestKey/@key))"/>
       </xsl:when>
       <xsl:otherwise>      
         <!--xsl:message select="'nearest key was false, using topkey'"/-->
@@ -2583,9 +2583,41 @@
     </xsl:choose>
   </xsl:function>
  
+  <xsl:function name="f:createValidName">
+    <xsl:param name="inputName"/>
+    <xsl:variable name="u">
+      <xsl:choose>
+        <xsl:when test="starts-with($inputName, '${')">
+          <xsl:sequence select=
+            "replace(replace($inputName, '\$\{', ''), '\}', '')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:sequence select=
+            "replace(
+              replace(
+               replace(
+                replace(
+                 replace(
+                  replace(
+                   replace( $inputName,'\?.*', '')
+                           ,',','_cm_')
+                          ,':','_c_')
+                         ,'//','_ss_')
+                       ,'/', '_s_')
+                      ,'\(','_op_')
+                     ,'\)','_cp_')
+                     "/>     
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+             
+    <xsl:sequence select="$u"/>
+  </xsl:function>         
+ 
+ 
   <xsl:function name="f:getQbrokerID">
     <xsl:param name="inputQueue"/>
-    <xsl:variable name="u">
+    <!-- xsl:variable name="u">
       <xsl:choose>
         <xsl:when test="starts-with($inputQueue/@brokerURL, '${')">
           <xsl:sequence select=
@@ -2609,9 +2641,9 @@
                      "/>     
         </xsl:otherwise>
       </xsl:choose>
-    </xsl:variable>
+    </xsl:variable-->
              
-    <xsl:sequence select="concat('qBroker_',$u)"/>
+    <xsl:sequence select="concat('qBroker_',f:createValidName($inputQueue/@brokerURL))"/>
   </xsl:function>         
   
   <xsl:function name="f:getEndpointName">



Mime
View raw message