You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2002/08/02 04:18:26 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/python xsp.xsl

vgritsenko    2002/08/01 19:18:26

  Modified:    .        changes.xml
               src/java/org/apache/cocoon/components/language/markup/xsp/java
                        xsp.xsl
               src/java/org/apache/cocoon/components/language/markup/xsp/javascript
                        xsp.xsl
               src/java/org/apache/cocoon/components/language/markup/xsp/python
                        xsp.xsl
  Log:
      XSP now verifies that value of attribute name on xsp:element does not
      contains ':'. To create namespaced elements, uri and prefix attributes
      must be used.
  
  Revision  Changes    Path
  1.226     +6 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.225
  retrieving revision 1.226
  diff -u -r1.225 -r1.226
  --- changes.xml	2 Aug 2002 02:04:35 -0000	1.225
  +++ changes.xml	2 Aug 2002 02:18:26 -0000	1.226
  @@ -39,6 +39,11 @@
    </devs>
   
    <release version="@version@" date="@date@">
  +  <action dev="VG" type="update">
  +    XSP now verifies that value of attribute name on xsp:element does not
  +    contains ':'. To create namespaced elements, uri and prefix attributes
  +    must be used.
  +  </action>
     <action dev="VG" type="fix">
       Request, response, and session logicsheet were incorrectly returning
       result when as="xml" is specified.
  
  
  
  1.11      +11 -9     xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl
  
  Index: xsp.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- xsp.xsl	19 Jun 2002 14:11:05 -0000	1.10
  +++ xsp.xsl	2 Aug 2002 02:18:26 -0000	1.11
  @@ -220,6 +220,14 @@
         </xsl:call-template>
       </xsl:variable>
   
  +    <xsl:if test="@name and contains(@name, ':')">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">[&lt;xsp:element name="<xsl:value-of select="@name"/>"&gt;]
  +Name can not contain ':'. If you want to create namespaced element, specify 'uri' and 'prefix'.
  +        </xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
       <xsl:variable name="name">
         <xsl:call-template name="get-parameter">
           <xsl:with-param name="name">name</xsl:with-param>
  @@ -262,8 +270,6 @@
             "<xsl:value-of select="local-name(.)"/>",
             "<xsl:value-of select="."/>");
         </xsl:if>
  -      <xsl:for-each select="$parent-element/namespace::*[local-name(.) = $ns-prefix and string(.) = $ns-uri]">
  -      </xsl:for-each>
       </xsl:for-each>
   
       <!-- Declare namespace defined by @uri and @prefix attribute -->
  @@ -273,8 +279,6 @@
             <xsl:value-of select="$prefix"/>,
             <xsl:value-of select="$uri"/>);
         </xsl:if>
  -      <xsl:for-each select="$parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri]">
  -      </xsl:for-each>
       </xsl:if>
   
       <xsl:apply-templates select="xsp:attribute | xsp:logic[xsp:attribute]"/>
  @@ -303,8 +307,6 @@
         <xsl:if test="not($parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri])">
           this.contentHandler.endPrefixMapping(<xsl:value-of select="$prefix"/>);
         </xsl:if>
  -      <xsl:for-each select="$parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri]">
  -      </xsl:for-each>
       </xsl:if>
   
       <xsl:for-each select="namespace::*">
  @@ -529,7 +531,7 @@
   
       <xsl:choose>
         <xsl:when test="@*[name(.) = $name]">"<xsl:value-of select="@*[name(.) = $name]"/>"</xsl:when>
  -      <xsl:when test="(*[namespace-uri(.)=$xsp-uri and local-name(.) = 'param'])[@name = $name]">
  +      <xsl:when test="xsp:param[@name = $name]">
           <xsl:call-template name="get-parameter-content">
             <xsl:with-param name="content"
                             select="(*[namespace-uri(.)=$xsp-uri and local-name(.) = 'param'])[@name = $name]"/>
  
  
  
  1.8       +11 -7     xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/javascript/xsp.xsl
  
  Index: xsp.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/javascript/xsp.xsl,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- xsp.xsl	19 Jun 2002 14:11:05 -0000	1.7
  +++ xsp.xsl	2 Aug 2002 02:18:26 -0000	1.8
  @@ -132,6 +132,14 @@
         </xsl:call-template>
       </xsl:variable>
   
  +    <xsl:if test="@name and contains(@name, ':')">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">[&lt;xsp:element name="<xsl:value-of select="@name"/>"&gt;]
  +Name can not contain ':'. If you want to create namespaced element, specify 'uri' and 'prefix'.
  +        </xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
       <xsl:variable name="name">
         <xsl:call-template name="get-parameter">
           <xsl:with-param name="name">name</xsl:with-param>
  @@ -179,8 +187,6 @@
         <xsl:if test="not($parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri])">
           contentHandler.startPrefixMapping(<xsl:value-of select="$prefix"/>, <xsl:value-of select="$uri"/>);
         </xsl:if>
  -      <xsl:for-each select="$parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri]">
  -      </xsl:for-each>
       </xsl:if>
   
       <xsl:apply-templates select="xsp:attribute | xsp:logic[xsp:attribute]"/>
  @@ -202,8 +208,6 @@
         <xsl:if test="not($parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri])">
           contentHandler.endPrefixMapping(<xsl:value-of select="$prefix"/>);
         </xsl:if>
  -      <xsl:for-each select="$parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri]">
  -      </xsl:for-each>
       </xsl:if>
   
       <xsl:for-each select="namespace::*">
  @@ -422,7 +426,7 @@
   
       <xsl:choose>
         <xsl:when test="@*[name(.) = $name]">"<xsl:value-of select="@*[name(.) = $name]"/>"</xsl:when>
  -      <xsl:when test="(*[namespace-uri(.)=$xsp-uri and local-name(.) = 'param'])[@name = $name]">
  +      <xsl:when test="xsp:param[@name = $name]">
           <xsl:call-template name="get-parameter-content">
             <xsl:with-param name="content"
                             select="(*[namespace-uri(.)=$xsp-uri and local-name(.) = 'param'])[@name = $name]"/>
  
  
  
  1.4       +11 -7     xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/python/xsp.xsl
  
  Index: xsp.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/python/xsp.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- xsp.xsl	19 Jun 2002 14:11:05 -0000	1.3
  +++ xsp.xsl	2 Aug 2002 02:18:26 -0000	1.4
  @@ -179,6 +179,14 @@
         </xsl:call-template>
       </xsl:variable>
   
  +    <xsl:if test="@name and contains(@name, ':')">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">[&lt;xsp:element name="<xsl:value-of select="@name"/>"&gt;]
  +Name can not contain ':'. If you want to create namespaced element, specify 'uri' and 'prefix'.
  +        </xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
       <xsl:variable name="name">
         <xsl:call-template name="get-parameter">
           <xsl:with-param name="name">name</xsl:with-param>
  @@ -242,8 +250,6 @@
           <xsl:text>)
   </xsl:text>
         </xsl:if>
  -      <xsl:for-each select="$parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri]">
  -      </xsl:for-each>
       </xsl:if>
   
       <!-- Attributes -->
  @@ -286,8 +292,6 @@
           <xsl:text>)
   </xsl:text>
         </xsl:if>
  -      <xsl:for-each select="$parent-element/namespace::*[local-name(.) = $prefix and string(.) = $uri]">
  -      </xsl:for-each>
       </xsl:if>
   
       <!-- End Namespaces -->
  @@ -697,7 +701,7 @@
   
       <xsl:choose>
         <xsl:when test="@*[name(.) = $name]">"<xsl:value-of select="@*[name(.) = $name]"/>"</xsl:when>
  -      <xsl:when test="(*[namespace-uri(.)=$xsp-uri and local-name(.) = 'param'])[@name = $name]">
  +      <xsl:when test="xsp:param[@name = $name]">
           <xsl:call-template name="get-parameter-content">
             <xsl:with-param name="content"
                             select="(*[namespace-uri(.)=$xsp-uri and local-name(.) = 'param'])[@name = $name]"/>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org