xquery comments limits

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

xquery comments limits

Dave Pawson-2
With the following query;
Saxon reports
Error on line 28 of file:/C:/sgml/docbook/v5/rng/atts.xq:
  XPST0008: Unresolved reference to variable $attdefs
Failed to compile query
The system cannot find the file specified.
Line 28 marked below.
Is it ignoring the delimiters?
http://www.w3.org/TR/xquery/#comments  seems to indicate
that comments may cross line boundaries?

regards DaveP


element els{
attribute version{$dp:version },
               (: Each element with attributes :)
  for $el in //rng:element[.//rng:ref[contains(@name,'.attlist')]][@name
eq 'year'],
      $attlistrefs in $el//rng:ref/@name,
      $attlistdefs in //rng:define[@name eq $attlistrefs],
      $attrefs in $attlistdefs//rng:ref[contains(@name,'attribute')],
      $attlists in //rng:define[@name eq $attrefs/@name],
      $attributes in //rng:define[@name eq
          $attlists//rng:ref[contains(@name,'attributes')]/@name ]
   (:   $attdefs in //rng:define[@name eq $attributes//rng:ref/@name] :)
    order by $el/@name
    return <el>{data($el/@name)}
               <refs>{$attlistrefs}</refs>
               <atts>{data($attrefs/@name)} </atts>
          (:     <attlists>{data($attlists/@name)}</attlists>
          <attlists >
            <att>{data($attdefs/rng:attribute/@name)}</att> ************ line
28 *************
          </attlists> :)
          <attributes>{data($attributes/@name)}</attributes>
       
</el>

 }

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
<a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=click">http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: xquery comments limits

David Carlisle

> Is it ignoring the delimiters?

(: are only recognised as comments at places that Xquery expressions
would be recognised as Xquery expressions. In the content of a direct
element constructor characters just stand for themselves, so (: would
just create a text node "(:" (if you hadn't got an error from the
undefined variable). You need to go inside {} before comments are
recognised.

This is exactly the same as in xslt attributes.

compare

<foo="(: ...:)"/>

<foo="{(: ...:)}"/>

David
(this should be on xquery-talk rather than saxon help, I'd guess,
perhaps you need to start up a faq list for xquery as well:-)

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: xquery comments limits

Michael Kay
In reply to this post by Dave Pawson-2
XQuery comments are not recognized in literal XML content. Thus

<hi>I love you (:</hi>

is a valid query that generates a <hi> element whose string value is "I love
you (:".

(Had me baffled for a minute or two...)

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> Dave Pawson
> Sent: 17 November 2005 12:54
> To: [hidden email]
> Subject: [saxon] xquery comments limits
>
> With the following query;
> Saxon reports
> Error on line 28 of file:/C:/sgml/docbook/v5/rng/atts.xq:
>   XPST0008: Unresolved reference to variable $attdefs
> Failed to compile query
> The system cannot find the file specified.
> Line 28 marked below.
> Is it ignoring the delimiters?
> http://www.w3.org/TR/xquery/#comments  seems to indicate
> that comments may cross line boundaries?
>
> regards DaveP
>
>
> element els{
> attribute version{$dp:version },
>                (: Each element with attributes :)
>   for $el in
> //rng:element[.//rng:ref[contains(@name,'.attlist')]][@name
> eq 'year'],
>       $attlistrefs in $el//rng:ref/@name,
>       $attlistdefs in //rng:define[@name eq $attlistrefs],
>       $attrefs in $attlistdefs//rng:ref[contains(@name,'attribute')],
>       $attlists in //rng:define[@name eq $attrefs/@name],
>       $attributes in //rng:define[@name eq
>           $attlists//rng:ref[contains(@name,'attributes')]/@name ]
>    (:   $attdefs in //rng:define[@name eq
> $attributes//rng:ref/@name] :)
>     order by $el/@name
>     return <el>{data($el/@name)}
>                <refs>{$attlistrefs}</refs>
>       <atts>{data($attrefs/@name)} </atts>
>  (:     <attlists>{data($attlists/@name)}</attlists>
>  <attlists >
>    <att>{data($attdefs/rng:attribute/@name)}</att>
> ************ line
> 28 *************
>  </attlists> :)
>           <attributes>{data($attributes/@name)}</attributes>
>
> </el>
>
>  }
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> http://www.dpawson.co.uk
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
> Register for a JBoss Training Course.  Free Certification Exam
> for All Training Attendees Through End of 2005. For more info visit:
> <a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=ick">http://ads.osdn.com/?ad_idv28&alloc_id845&op=ick
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
<a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=click">http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: xquery comments limits

Dave Pawson-2
On 17/11/05, Michael Kay <[hidden email]> wrote:
> XQuery comments are not recognized in literal XML content. Thus
>
> <hi>I love you (:</hi>
>
> is a valid query that generates a <hi> element whose string value is "I love
> you (:".
>
> (Had me baffled for a minute or two...)

Thanks Mike (and David).

Back on track.

regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
<a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=click">http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help