[Webkit-unassigned] [Bug 56184] New: Problem in substring-before() and substring-after() XPath methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 11 06:34:59 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=56184

           Summary: Problem in substring-before() and substring-after()
                    XPath methods
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: XML
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: yusufkoseoglu287 at gmail.com


<xsl:template name="createRadioButton">
        <xsl:param name="list" /><!-- something like : true|false|bla|bla -->
        <xsl:param name="delimiter" /> <!-- "|" -->
        <xsl:param name="nameofradio" /> <!-- sampleName -->
        <xsl:param name="valueofradio" /> <!-- sampleValue -->
        <xsl:variable name="newlist">
              <xsl:choose>
                  <xsl:when test="contains($list, $delimiter)">
                    <xsl:value-of select="normalize-space($list)" />
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="concat(normalize-space($list), $delimiter)"/>
                  </xsl:otherwise>
              </xsl:choose>
          </xsl:variable>
          <!-- problem is these two lines. When I assign something else it works.-->
          <xsl:variable name="first" select="substring-before($newlist, $delimiter)" />
          <xsl:variable name="remaining" select="substring-after($newlist, $delimiter)" />
          <xsl:element name="input">
            <xsl:attribute name="type">radio</xsl:attribute>
            <xsl:attribute name="name"><xsl:value-of select="$nameofradio"/></xsl:attribute>
            <xsl:attribute name="value"><xsl:value-of  select="$first"/></xsl:attribute>
            <xsl:choose>
                <xsl:when test="@hassection='true'">
                    <xsl:attribute name="onclick">showHiddenTable(this.value);validateFormElement(this.name,this.value);</xsl:attribute>        
                </xsl:when>
                <xsl:when test="$valueofradio = $first">
                    <xsl:attribute name="checked">checked</xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:attribute name="onclick">validateFormElement(this.name,this.value)</xsl:attribute>        
                </xsl:otherwise>
            </xsl:choose>

          </xsl:element>
          <xsl:value-of select="$first" />
          <xsl:if test="$remaining">
              <xsl:call-template name="createRadioButton">
                  <xsl:with-param name="list" select="$remaining" />
                  <xsl:with-param name="delimiter"><xsl:value-of select="$delimiter"/></xsl:with-param>
                  <xsl:with-param name="nameofradio"><xsl:value-of select="$nameofradio"/></xsl:with-param>
                  <xsl:with-param name="valueofradio"><xsl:value-of select="$valueofradio"/></xsl:with-param>
              </xsl:call-template>
          </xsl:if>
    </xsl:template> 

This simple code does not work on WebKit version: 532.4

When i assign static values to "first" and "remaining" variables, there is no problem. But when it comes to substring-before or substring-after, there comes problem. You can see stackoverflow question for detailed answers. It has been tried in 9 different XSLT processors by Dimitre Novatchev, and again there is no problem.
http://stackoverflow.com/questions/5271266/substring-before-and-substring-after-problem-in-webkit-engine-based-browser

Thanks
Yusuf Koseoglu

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list