<?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>3442</bug_id>
          
          <creation_ts>2006-07-10 15:48:27 +0000</creation_ts>
          <short_desc>[XQueryX] Computed Processing Instruction Constructors</short_desc>
          <delta_ts>2006-07-31 15:18:41 +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="Andrew Eisenberg">andrew.eisenberg</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>10441</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2006-07-10 15:48:27 +0000</bug_when>
    <thetext>There seems to be a small anomaly concering xqx:computedPIConstructor. The schema allows the piValueExpr to be omitted:

  &lt;xsd:complexType name=&quot;computedPIConstructor&quot;&gt;
    &lt;xsd:complexContent&gt;
      &lt;xsd:extension base=&quot;expr&quot;&gt;
        &lt;xsd:sequence&gt;
          &lt;xsd:choice&gt;
            &lt;xsd:element name=&quot;piTarget&quot; type=&quot;xsd:NCName&quot;/&gt;
            &lt;xsd:element name=&quot;piTargetExpr&quot; type=&quot;exprWrapper&quot;/&gt;
          &lt;/xsd:choice&gt;
          &lt;xsd:element name=&quot;piValueExpr&quot; type=&quot;exprWrapper&quot; minOccurs=&quot;0&quot;/&gt;
        &lt;/xsd:sequence&gt;
      &lt;/xsd:extension&gt;
    &lt;/xsd:complexContent&gt;
  &lt;/xsd:complexType&gt;

The stylesheet for xqx:computedPIConstructor, on the other hand, does not take any special action when it is omitted:

  &lt;xsl:template match=&quot;xqx:computedPIConstructor&quot;&gt;
    &lt;xsl:text&gt; processing-instruction &lt;/xsl:text&gt;
    &lt;xsl:value-of select=&quot;xqx:piTarget&quot;/&gt;
    &lt;xsl:apply-templates select=&quot;xqx:piTargetExpr&quot;/&gt;
    &lt;xsl:apply-templates select=&quot;xqx:piValueExpr&quot;/&gt;
  &lt;/xsl:template&gt;


This means that the following XQueryX document is accepted by the schema:

&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;xqx:module xmlns:xqx=&quot;http://www.w3.org/2005/XQueryX&quot;
            xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
            xsi:schemaLocation=&quot;http://www.w3.org/2005/XQueryX
                                http://www.w3.org/2005/XQueryX/xqueryx.xsd&quot;&gt;
  &lt;xqx:mainModule&gt;
    &lt;xqx:queryBody&gt;
      &lt;xqx:elementConstructor&gt;
        &lt;xqx:tagName&gt;elem&lt;/xqx:tagName&gt;
        &lt;xqx:elementContent&gt;
          &lt;xqx:computedPIConstructor&gt;
            &lt;xqx:piTarget&gt;pi&lt;/xqx:piTarget&gt;
          &lt;/xqx:computedPIConstructor&gt;
        &lt;/xqx:elementContent&gt;
      &lt;/xqx:elementConstructor&gt;
    &lt;/xqx:queryBody&gt;
  &lt;/xqx:mainModule&gt;
&lt;/xqx:module&gt;

The stylesheet transforms this into the following, which is not a valid XQuery:

&lt;elem&gt;{ processing-instruction pi}&lt;/elem&gt;

Either the xqx:piValueExpr should be made mandatory, or the stylesheet should generate an additional &quot;{}&quot; when it is omitted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10875</commentid>
    <comment_count>1</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2006-07-28 21:56:16 +0000</bug_when>
    <thetext>Thanks for this bug report.  The XQueryX stylesheet has been revised so that the braces are output unconditionally instead of only when the XQueryX document specifies a value for the PI constructor.

Since this would appear to completely resolve your comment, you are requested to mark this bug CLOSED at your earliest convenience. </thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>