The other downside of using XML comments is that the body is still interpreted
by XQuery
This can lead to breakage or performance issues
e.g
<Point>
<!-- I thought I had commented this out but { ups this breaks } -->
<!-- { for i in 1 to 10000000000000000000000 return $i * $i } I
thought I commented that out !!! -->
----------------------------------------
David A. Lee
[email protected]<mailto:[email protected]>
http://www.xmlsh.org
From: Christian Grün [mailto:[email protected]]
Sent: Thursday, December 20, 2012 10:59 AM
To: David Lee
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [xquery-talk] let's comment out a line in XQuery
You may as well want to use XML comments, as long as you are moving within XML
constructs:
<Point>
<!-- <coordinates> ALLOW ME TO COMMENT OUT THIS LINE</coordinates> -->
Of course, this comment will then also be part of the constructed XML fragment.
Christian
_______________________________
> As per the mailing list archive link I sent yesterday.
> Use this to comment out data inside XML literal constructors
>
> <Point>
> { (: <coordinates> ALLOW ME TO COMMENT OUT THIS LINE</coordinates>
> :) }
> ...
>
>
>
>
> ----------------------------------------
> David A. Lee
> [email protected]<mailto:[email protected]>
> http://www.xmlsh.org
>
> -----Original Message-----
> From: [email protected]<mailto:[email protected]>
> [mailto:[email protected]<mailto:[email protected]>] On Behalf
> Of [email protected]<mailto:[email protected]>
> Sent: Thursday, December 20, 2012 10:39 AM
> To: [email protected]<mailto:[email protected]>
> Cc: [email protected]<mailto:[email protected]>
> Subject: Re: [xquery-talk] let's comment out a line in XQuery
>
> I don't have a Senior Secondary Certificate of Education :-) but here
> goes anyway. basex: Debian's 7.3-1.
> $ basex noise0.xq |wc
> Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise0.xq:
> [XPTY0004] Single item expected, ( ALLOW ME TO COMMENT OUT THIS LINE, ...)
> found.
> 0 0 0
> $ cat noise0.xq
> (:
> # Make a map of noisy neighbors, Xquery version.
> # Copyright : http://www.fsf.org/copyleft/gpl.html
> # Author : Dan Jacobson -- http://jidanni.org/
> # Created On : Sat Jan 29 17:28:12 2011
> # Last Modified On: Thu Dec 20 23:29:24 2012
> # Update Count : 122
> :)
> declare option output:omit-xml-declaration "no";
> declare function local:fol($f){
> (: just adds lines between the first point and the rest :)
> <Folder>
> {$f/*}
> <Folder>
> <name>(lines)</name>
> <open>0</open>
> {
> for $p at $c in $f/*:Placemark
> where $c > 1
> return
> <Placemark>
> <name>{concat($f/*:Placemark[$c]//*:name/text()," to ",
> $f/*:Placemark[ 1]//*:name/text())}</name>
> <LineString>
> <coordinates>{concat($f/*:Placemark[$c]//*:coordinates/text()," ",
> $f/*:Placemark[ 1]//*:coordinates/text())}</coordinates>
> </LineString>
> </Placemark>
> } </Folder>
> </Folder>}
> ;
> <kml xmlns="http://www.opengis.net/kml/2.2">
> {comment {"Made by noise.xq, will get OVERWRITTEN"}}
> <Document>
> <Folder>
> <name>噪音 Noise</name>
> <description>http://jidanni.org/me/quiet.html</description>
> {local:fol(
> <Folder>
> <name>�c福街 1-3 Qingfu St.</name>
> <Placemark>
> <name>1-3</name>
> <Point>
> (: <coordinates> ALLOW ME TO COMMENT OUT THIS LINE</coordinates>
> :)
> <coordinates>120.865201,24.181712</coordinates> (: 2012/12 Google
> satellite :)
> </Point>
> </Placemark>
> <Placemark>
> <name>Luo Yuntian</name>
> <Point>
> <coordinates>120.868205,24.176483</coordinates>
> </Point>
> </Placemark>
> <Placemark>
> <name>Zhong Guilin</name>
> <Point>
> <coordinates>120.866934,24.152642</coordinates>
> </Point>
> </Placemark>
> <Placemark>
> <name>Maan Nong Zhuang</name>
> <Point>
> <coordinates>120.84368,24.17268</coordinates> (:
> �|���^�c福里007��-�|�P路147�� :)
> </Point>
> </Placemark>
> </Folder>)}
> {local:fol(
> <Folder>
> <name>�c福街 1-6 Qingfu St.</name>
> <Placemark>
> <name>1-6</name>
> <Point>
> <coordinates>120.866215,24.181668</coordinates>
> </Point>
> </Placemark>
> <Placemark>
> <name>Liu Shiqing</name>
> <Point>
> <coordinates>120.86981,24.19667</coordinates> (: Approx :)
> </Point>
> </Placemark>
> <Placemark>
> <name>Wu Yuxuan</name>
> <Point>
> <coordinates>120.86981,24.18811</coordinates>
> </Point>
> </Placemark>
> <Placemark>
> <name>Chen Chunlai</name>
> <Point>
> <coordinates>120.877008,24.187393</coordinates>
> </Point>
> </Placemark>
> <Placemark>
> <name>Chen Zhenfeng</name>
> <Point>
> <coordinates>120.87456,24.18333</coordinates>
> </Point>
> </Placemark>
> <Placemark>
> <name>Dazhong</name>
> <Point>
> <coordinates>120.872499,24.200025</coordinates>
> </Point>
> </Placemark>
> <Placemark>
> <name>Liu Jinxing</name>
> <Point>
> <coordinates>120.874624,24.193282</coordinates>
> </Point>
> </Placemark>
> <Placemark>
> <name>Zeng Pingzhu</name>
> <Point>
> <coordinates>120.868530,24.183716</coordinates>
> </Point>
> </Placemark>
> </Folder>)}
> </Folder>
> </Document>
> </kml>
>
> _______________________________________________
> [email protected]<mailto:[email protected]>
> http://x-query.com/mailman/listinfo/talk
>
> _______________________________________________
> [email protected]<mailto:[email protected]>
> http://x-query.com/mailman/listinfo/talk
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk