This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 379 - setIsElementContentWhitespace is produced instead of setElementContentWhitespace
Summary: setIsElementContentWhitespace is produced instead of setElementContentWhitespace
Status: RESOLVED FIXED
Alias: None
Product: DOM TS
Classification: Unclassified
Component: DOM Level 3 (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: Curt Arnold
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-18 03:10 UTC by Curt Arnold
Modified: 2003-11-18 08:40 UTC (History)
0 users

See Also:


Attachments

Description Curt Arnold 2003-11-18 03:10:17 UTC
The Java binding generation was modified in L3 to produce an isWhatever() and
setWhatever() methods when the attribute name started with is, the third
character was uppercase and the name was not isMap (used in L2 HTML). 
test-to-java had not been updated to be consistent.
Comment 1 Curt Arnold 2003-11-18 03:40:18 UTC
Index: test-to-java.xsl
===================================================================
RCS file: /sources/public/2001/DOM-Test-Suite/transforms/test-to-java.xsl,v
retrieving revision 1.44
diff -u -r1.44 test-to-java.xsl
--- test-to-java.xsl	10 Nov 2003 07:34:13 -0000	1.44
+++ test-to-java.xsl	18 Nov 2003 08:37:26 -0000
@@ -1731,16 +1731,28 @@
     <xsl:param name="attribute"/>
     <xsl:variable name="obj" select="@obj"/>
     <xsl:variable name="value" select="@value"/>
+    <!--  check if attribute name starts with is  -->
+    <xsl:variable name="startsWithIs" select="substring($attribute/@name, 1, 2)
= 'is' and $attribute/@name != 'isMap' and
contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', substring($attribute/@name, 3, 1))"/>
     <xsl:if test="@value">
         <xsl:call-template name="cast">
             <xsl:with-param name="var" select="$obj"/>
             <xsl:with-param name="vartype" select="$vardefs[@name = $obj]/@type"/>
             <xsl:with-param name="reqtype"
select="$attribute/parent::interface/@name"/>
         </xsl:call-template>
-        <xsl:call-template name="build-accessor">
-            <xsl:with-param name="prefix">.set</xsl:with-param>
-            <xsl:with-param name="attribute" select="$attribute/@name"/>
-        </xsl:call-template>
+	<xsl:choose>
+	   <xsl:when test="$startsWithIs">ls ls /.
+        	<xsl:call-template name="build-accessor">
+            		<xsl:with-param name="prefix">.set</xsl:with-param>
+            		<xsl:with-param name="attribute"
select="substring($attribute/@name, 3)"/>
+        	</xsl:call-template>
+           </xsl:when>
+	   <xsl:otherwise>
+        	<xsl:call-template name="build-accessor">
+            		<xsl:with-param name="prefix">.set</xsl:with-param>
+            		<xsl:with-param name="attribute" select="$attribute/@name"/>
+        	</xsl:call-template>
+           </xsl:otherwise>
+        </xsl:choose>
         <xsl:text>(</xsl:text>
             <xsl:call-template name="produce-param">
                 <xsl:with-param name="value" select="@value"/>
@@ -1764,10 +1776,20 @@
             <xsl:with-param name="vartype" select="$vardefs[@name = $obj]/@type"/>
             <xsl:with-param name="reqtype"
select="$attribute/parent::interface/@name"/>
         </xsl:call-template>
-        <xsl:call-template name="build-accessor">
-            <xsl:with-param name="prefix">.get</xsl:with-param>
-            <xsl:with-param name="attribute" select="$attribute/@name"/>
-        </xsl:call-template>
+        <xsl:choose>
+	     <xsl:when test="$startsWithIs">
+        	<xsl:call-template name="build-accessor">
+            		<xsl:with-param name="prefix">.is</xsl:with-param>
+            		<xsl:with-param name="attribute"
select="substring($attribute/@name, 3)"/>
+        	</xsl:call-template>
+             </xsl:when>
+	     <xsl:otherwise>
+        	<xsl:call-template name="build-accessor">
+            		<xsl:with-param name="prefix">.get</xsl:with-param>
+            		<xsl:with-param name="attribute" select="$attribute/@name"/>
+        	</xsl:call-template>
+	     </xsl:otherwise>
+        </xsl:choose>
         <xsl:text>();</xsl:text>
     </xsl:if>
 </xsl:template>