<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6855</bug_id>
          
          <creation_ts>2009-04-30 16:15:41 +0000</creation_ts>
          <short_desc>OBJECTS_OR_SCRIPT-2 FAIL may be overriden by OBJECTS_OR_SCRIPT-3 WARN</short_desc>
          <delta_ts>2009-05-04 11:28:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>mobileOK Basic checker</product>
          <component>Java Library</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="fd">fd</reporter>
          <assigned_to name="fd">fd</assigned_to>
          
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>24974</commentid>
    <comment_count>0</comment_count>
    <who name="fd">fd</who>
    <bug_when>2009-04-30 16:15:41 +0000</bug_when>
    <thetext>When an anchor contains both an href with a Javascript URI and an event attribute, the OBJECTS_OR_SCRIPT-3 WARN on the event attribute is triggered, but not the OBJECTS_OR_SCRIPT-3 FAIL on the javascript link.

Ex:
 &lt;a href=&quot;javascript:test()&quot; onmouseout=&quot;mouseOut();&quot;&gt;link&lt;/a&gt;

I added a test in the test suite to track the bug:
 ObjectsOrScriptTest/6/index.xhtml

The error occurs because two XSLT templates match the link, which creates an ambiguous rule match that gets silently recovered by Saxon. Saxon basically chooses one of the templates, and not the one we want in our case, since there should be a FAIL, and only a WARN is retrieved!

The error is signaled by Saxon as:
[[[
Error 
  XTRE0540: Ambiguous rule match for
  /moki/primaryDoc[1]/XHTMLDocInfo[1]/docContent[1]/html[1]/body[1]/div[2]/div[3]/div[1]/div[2]/div[1]/span[1]/a[2]
Matches both &quot;html:a[starts-with(lower-case(@href),&apos;javascript:&apos;)]&quot; on line 71 of mobileok-ref/build/org/w3c/mwi/mobileok/basic/xslt/ObjectsOrScriptTest.xsl
and &quot;html:*[@onload or @onunload or @onclick or @ondblclick or @onmousedown or @onmouseup or @onmouseover or @onmousemove or @onmouseout or @onfocus or @onblur or @onkeypress or @onkeydown or @onkeyup or @onsubmit or @onreset or @onselect or @onchange]&quot; on line 189 of mobileok-ref/build/org/w3c/mwi/mobileok/basic/xslt/ObjectsOrScriptTest.xsl
]]]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25000</commentid>
    <comment_count>1</comment_count>
    <who name="fd">fd</who>
    <bug_when>2009-05-04 11:28:04 +0000</bug_when>
    <thetext>I removed the ambiguity in the template rules in:
 ObjectOrScriptsTest.xsl
 StyleSheetsUseTest.xsl

The solution I used was to define a named template, e.g. checkStyleAttribute that gets called explicitly whenever an html:[foo] element gets processed.
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>