<?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>29516</bug_id>
          
          <creation_ts>2016-03-03 12:04:21 +0000</creation_ts>
          <short_desc>[ser31] Definitions spanning paragraphs</short_desc>
          <delta_ts>2016-09-02 11:02:00 +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>Serialization 3.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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>
          
          <blocked>29513</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          <cc>andrew_coleman</cc>
          
          <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>125333</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-03 12:04:21 +0000</bug_when>
    <thetext>See the definition of https://www.w3.org/TR/xslt-xquery-serialization-31/#to-a-json-string

At first sight it appears that the spec has solved the problem of writing a multi-paragraph definition, highlighted in bug #29513 against the XSLT 3.0 specification.

However, on closer examination it appears that the markup is not DTD-valid, so it&apos;s not a solution to the problem at all (and I&apos;m surprised that the build succeeds).  It has a &lt;p&gt; which contains a &lt;termdef&gt; which contains an &lt;olist&gt;. Our markup doesn&apos;t allow lists within paragraphs, so this breaks the rules.

It would be good to enhance the DTD and stylesheet for all the specs to allow multi-paragraph definitions. Note that there are many cases in the serialization spec where a definition ends in mid-sentence because of this limitation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125334</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-03 12:20:54 +0000</bug_when>
    <thetext>Solving this is tricky if only because of the complexity of the DTD design and the fact that few of us write DTDs every day. The fact that there is quite a bit of stylesheet machinery around termref/xtermref/termdef means we need to be cautious.

I&apos;m inclined to the following rather clunky solution:

(a) add an attribute &lt;termdef open=&quot;true&quot;&gt; to indicate that the termdef continues beyond the end of the actual termdef element;

(b) add the markup &lt;p role=&quot;closetermdef&quot;/&gt; to signal the end of the most recent open termdef.

The only stylesheet changes are then, I think

(i) Change or override the match=&quot;termdef&quot; template (xmlspec line 2145), currently

  &lt;xsl:template match=&quot;termdef&quot;&gt;
    &lt;xsl:text&gt;[&lt;/xsl:text&gt;
    &lt;a name=&quot;{@id}&quot; id=&quot;{@id}&quot; title=&quot;{@term}&quot;&gt;
      &lt;xsl:text&gt;Definition&lt;/xsl:text&gt;
    &lt;/a&gt;
    &lt;xsl:text&gt;: &lt;/xsl:text&gt;
    &lt;xsl:apply-templates/&gt;
    &lt;xsl:text&gt;]&lt;/xsl:text&gt;
  &lt;/xsl:template&gt;

to omit the closing &quot;]&quot; if open=&quot;true&quot;

(ii) Add a template rule

&lt;xsl:template match=&quot;p[@role=&apos;closetermdef&apos;]&quot;&gt;
  &lt;p&gt;]&lt;/p&gt;
&lt;/xsl:template&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125335</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-03 12:30:43 +0000</bug_when>
    <thetext>And of course we have to change the stylesheet code that produces the glossary (xsl-query.xsl line 546). I&apos;m not sure about the diff case, but the non-diff code replaces

        &lt;dd&gt;
          &lt;p&gt;
            &lt;xsl:apply-templates/&gt;
          &lt;/p&gt;
        &lt;/dd&gt;

by 
        &lt;dd&gt;
          &lt;p&gt;
            &lt;xsl:apply-templates/&gt;
          &lt;/p&gt;
          &lt;xsl:if test=&quot;@open=&apos;true&apos;&quot;&gt;
            &lt;xsl:variable name=&quot;close&quot; select=&quot;../p[@role=&apos;closetermdef&apos;][1]&quot;/&gt;
            &lt;xsl:apply-templates select=&quot;../following-sibling::*[$close &gt;&gt; .]&quot;/&gt;
          &lt;/xsl:if&gt;
        &lt;/dd&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125348</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-04 00:08:45 +0000</bug_when>
    <thetext>I have provisionally made (but not committed) the suggested DTD and stylesheet changes, and used them for four definitions in the XSLT spec that logically ran into multiple paragraphs.

I found that some of the templates needing change were overridden in the XSLT version of the stylesheets, so the changes to the base templates have not actually been tested by this process.

(In the course of this I noticed that oXygen, which I use for authoring the specs, was actually using its own version of xmlspec to validate the documents, rather than using the version that we link to. So changing the DTD didn&apos;t clear the apparent validation errors. I&apos;ve changed my oXygen configuration to prevent this happening. But the serialization spec still shows up as DTD-invalid.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127270</commentid>
    <comment_count>4</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2016-09-02 11:02:00 +0000</bug_when>
    <thetext>This was discussed between the editors, and it was decided not to make any changes to the serialization spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>