<?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>29825</bug_id>
          
          <creation_ts>2016-09-15 19:19:29 +0000</creation_ts>
          <short_desc>[FO31] (editorial) Some inline code samples with more than one function name in it get hyperlinked, leading to hard-to-read text</short_desc>
          <delta_ts>2016-12-16 19:55:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>editorial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abel Braaksma">abel.braaksma</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>127398</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-09-15 19:19:29 +0000</bug_when>
    <thetext>The formula used for calculating idiv is hard to read because it is fully underlined and linked to the fn:abs function. There are more functions in this calculation, it seems odd to link it to fn:abs, or to link it at all. 

I suggest to either link the individual functions, or to remove the link entirely.

The hyperlinked text in 4.2.5 is: 

fn:abs($N * $arg2) le fn:abs($arg1) and fn:compare($N * $arg2, 0) eq fn:compare($arg1, 0).

As an aside, I think writing it out is (arguably) more readable:

fn:abs($N * $arg2) le fn:abs($arg1) 
and 
fn:compare($N * $arg2, 0) eq fn:compare($arg1, 0)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127400</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-09-15 22:44:19 +0000</bug_when>
    <thetext>Unfortunately the markup and stylesheet I inherited in F+O doesn&apos;t mark up function names with &lt;function&gt;fn:abs&lt;/function&gt;, it marks them as &lt;code&gt;fn:abs&lt;/code&gt;, and the stylesheet interprets a code element starting with fn: as a hyperlink. Horrid, but it&apos;s a lot of work to change it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127402</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-09-16 13:09:45 +0000</bug_when>
    <thetext>How does it work on other places then? For instance, the following appears to be formatted as &lt;code&gt;...&lt;/code&gt;, but does not get underlined:

From 4.5.1. fn:number
* The expression fn:number($item2/description) returns xs:double(&apos;NaN&apos;).
* Then fn:number() returns 1.5e1.

There appears to be a certain randomness, but the majority goes right for inline code samples (when starting with a function name), and where it is just the QName of the function, not a code sample, it is about a 6:4 chance:

* code samples, 15x wrong, 2+ fu names linked
  with: //code[(parent::*:a)][text()[matches(., &apos;^[fma]\w+:\c+.*\w+:\w+&apos;)]]

* code samples, 169x right (no linking for 2+ fu names)
  with: //code[not(parent::*:a)][text()[matches(., &apos;^[fma]\w+:\c+.*\w+:\w+&apos;)]]

* single function names, 406 times arguably wrong (no linking)
  with: //code[not(parent::*:a)][text()[matches(., &apos;[fma]\w+:[\c#]+$&apos;)]]

* function names, 570 times right (with linking)
  with: //code[parent::*:a][text()[matches(., &apos;[fma]\w+:[\c#]+$&apos;)]]

But I understand that, esp. if it is hard to fix, there are better things to do right now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127458</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-09-20 21:35:53 +0000</bug_when>
    <thetext>Many of those that are not underlined are marked up as executable examples rather than with code markup:

            &lt;fos:test&gt;
               &lt;fos:expression&gt;fn:number($item1/quantity)&lt;/fos:expression&gt;
               &lt;fos:result&gt;5.0e0&lt;/fos:result&gt;
            &lt;/fos:test&gt;

There is actually a step in the build process to run these examples as test cases, but it&apos;s a while since I ran it (mainly because until recently, there have been many examples that weren&apos;t yet executable in Saxon).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127459</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-09-20 22:06:00 +0000</bug_when>
    <thetext>I have changed the stylesheet so that it only creates a hyperlink for &lt;code&gt; markup if the code consists of a standalone QName (not part of a larger expression).

I have changed the code in 4.2.5 to use block-level &lt;eg&gt; markup instead of inline &lt;code&gt; markup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127465</commentid>
    <comment_count>5</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-09-21 00:40:03 +0000</bug_when>
    <thetext>Thanks, that&apos;s a good readability improvement (I assume with QName you also mean to underline function references like fn:concat#3?)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>