<?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>3520</bug_id>
          
          <creation_ts>2006-07-20 22:41:33 +0000</creation_ts>
          <short_desc>[XQueryX] multiple target locations</short_desc>
          <delta_ts>2006-08-01 09:37:26 +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>XQueryX 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Carlisle">davidc</reporter>
          <assigned_to name="Jim Melton">jim.melton</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>10634</commentid>
    <comment_count>0</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2006-07-20 22:41:33 +0000</bug_when>
    <thetext>The stylesheet templates for xqx:moduleImport and xqx:schemaImport
both have the construct


    &lt;xsl:if test=&quot;xqx:targetLocation&quot;&gt;
      &lt;xsl:text&gt; at &lt;/xsl:text&gt;
      &lt;xsl:call-template name=&quot;quote&quot;&gt;
        &lt;xsl:with-param name=&quot;item&quot; select=&quot;xqx:targetLocation&quot;/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:if&gt;


which has the effect that if there are multiple xqx:targetLocation (as allowed by the schema, and the XQuery EBNF) then all but the first are quietly dropped.

I suggest replacing this in both cases by

&lt;xsl:apply-templates select=&quot;xqx:targetLocation&quot;/&gt;

and adding


&lt;xsl:template match=&quot;xqx:targetLocation&quot;&gt;
  &lt;xsl:choose&gt;
   &lt;xsl:when test=&quot;position()=1&quot;&gt; at &lt;/xsl:when&gt;
   &lt;xsl:otherwise&gt;, &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
    &lt;xsl:call-template name=&quot;quote&quot;&gt;
      &lt;xsl:with-param name=&quot;item&quot; select=&quot;.&quot;/&gt;
    &lt;/xsl:call-template&gt;
&lt;/xsl:template&gt;

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10922</commentid>
    <comment_count>1</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2006-08-01 01:34:53 +0000</bug_when>
    <thetext>Thank you for your comment.  You are obviously correct and I agree with your proposed solution, which I have implemented. 

Consequently, I am marking this bug FIXED.  If, after testing, you agree that the bug is, indeed, fixed, please mark it CLOSED. 

(I will post the revised stylesheet shortly.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>