Allowing for comments in code...

Thursday, 2 February 2017 · 7 messages · last reply 18 Feb 2017
FB
France Baril2 Feb 2017 00:01 #
I was wondering if it would be possible to either: * Allow for an omit-comment option in HTML5 serializer * Allow for {(: Nothing but a comment :)} in xquery code. I often have long pieces of HTML to output and clients don't want me to output them with the result. However, I can't use {(::)}. I have been using useless code around my comments just to get around this issue:
{

   let $t := '' return $t
(: The comment I can't leave without the bogus code:) } Thanks!
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com
MG
Murray, Gregory2 Feb 2017 00:54 #
Have you tried just an empty sequence? {() (: comment... :)}
Quoted text · France Baril · 1 line
On Feb 1, 2017, at 5:01 PM, France Baril <france.baril at architextus.com<mailto:france.baril at architextus.com>> wrote:
I was wondering if it would be possible to either: * Allow for an omit-comment option in HTML5 serializer * Allow for {(: Nothing but a comment :)} in xquery code. I often have long pieces of HTML to output and clients don't want me to output them with the result. However, I can't use {(::)}. I have been using useless code around my comments just to get around this issue:
{

   let $t := '' return $t
(: The comment I can't leave without the bogus code:) } Thanks!
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com<mailto:france.baril at architextus.com>
CG
Christian Grünin reply to France Baril, 2 Feb 2017, 19:482 Feb 2017 19:17 #
The following query is a valid XQuery 3.1 expression:
  <x>{ (: bla :) }</x>
Do you use an older version of XQuery or BaseX? Are you looking for something else_
Quoted text · France Baril · 48 lines
On Thu, Feb 2, 2017 at 6:48 PM, France Baril <france.baril at architextus.com> wrote: > Cleaner fake code... A less ugly hack ;-)... > > On Wed, Feb 1, 2017 at 6:54 PM, Murray, Gregory <gregory.murray at ptsem.edu> > wrote: >> >> Have you tried just an empty sequence? >> >> {() (: comment... :)} >> >> >> On Feb 1, 2017, at 5:01 PM, France Baril <france.baril at architextus.com> >> wrote: >> >> I was wondering if it would be possible to either: >> >> * Allow for an omit-comment option in HTML5 serializer >> * Allow for {(: Nothing but a comment :)} in xquery code. >> >> I often have long pieces of HTML to output and clients don't want me to >> output them with the result. However, I can't use {(::)}. I have been using >> useless code around my comments just to get around this issue: >> >> { >> >> let $t := '' return $t >> >> (: The comment I can't leave without the bogus code:) >> >> } >> >> >> Thanks! >> >> >> -- >> France Baril >> Architecte documentaire / Documentation architect >> france.baril at architextus.com > > > > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com
FB
France Barilin reply to Murray, Gregory, 2 Feb 2017, 00:542 Feb 2017 19:48 #
Cleaner fake code... A less ugly hack ;-)...
Quoted text · Gregory · 36 lines
On Wed, Feb 1, 2017 at 6:54 PM, Murray, Gregory <gregory.murray at ptsem.edu> wrote: > Have you tried just an empty sequence? > > {() (: comment... :)} > > > On Feb 1, 2017, at 5:01 PM, France Baril <france.baril at architextus.com> > wrote: > > I was wondering if it would be possible to either: > > * Allow for an omit-comment option in HTML5 serializer > * Allow for {(: Nothing but a comment :)} in xquery code. > > I often have long pieces of HTML to output and clients don't want me to > output them with the result. However, I can't use {(::)}. I have been using > useless code around my comments just to get around this issue: > > { > > let $t := '' return $t > > (: The comment I can't leave without the bogus code:) > > } > > Thanks! > > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com > >
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com
FB
France Barilin reply to Christian Grün, 2 Feb 2017, 19:1718 Feb 2017 01:27 #
Maybe my issue is that I am trying to add the comment between elements?
<html>
         <head>
            <title>{*$dash-cms-name*}</title>{(:blah:)}
            <meta *http-equiv*=*"expires"* *content*=*"Mon, 22 Jul 2020
11:12:01 GMT"*/>
returns [XPST0003] Expecting valid expression after curly brace.
Quoted text · Christian Grün · 61 lines
On Thu, Feb 2, 2017 at 1:17 PM, Christian Grün <christian.gruen at gmail.com> wrote: > The following query is a valid XQuery 3.1 expression: > > <x>{ (: bla :) }</x> > > Do you use an older version of XQuery or BaseX? Are you looking for > something else_ > > > On Thu, Feb 2, 2017 at 6:48 PM, France Baril > <france.baril at architextus.com> wrote: > > Cleaner fake code... A less ugly hack ;-)... > > > > On Wed, Feb 1, 2017 at 6:54 PM, Murray, Gregory < > gregory.murray at ptsem.edu> > > wrote: > >> > >> Have you tried just an empty sequence? > >> > >> {() (: comment... :)} > >> > >> > >> On Feb 1, 2017, at 5:01 PM, France Baril <france.baril at architextus.com> > >> wrote: > >> > >> I was wondering if it would be possible to either: > >> > >> * Allow for an omit-comment option in HTML5 serializer > >> * Allow for {(: Nothing but a comment :)} in xquery code. > >> > >> I often have long pieces of HTML to output and clients don't want me to > >> output them with the result. However, I can't use {(::)}. I have been > using > >> useless code around my comments just to get around this issue: > >> > >> { > >> > >> let $t := '' return $t > >> > >> (: The comment I can't leave without the bogus code:) > >> > >> } > >> > >> > >> Thanks! > >> > >> > >> -- > >> France Baril > >> Architecte documentaire / Documentation architect > >> france.baril at architextus.com > > > > > > > > > > -- > > France Baril > > Architecte documentaire / Documentation architect > > france.baril at architextus.com >
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com
CG
Christian Grün18 Feb 2017 01:28 #
Your query works for me (if I define a value for $dash-cms-name, and if I close the head and html elements). Hm. • Are you sure you aren’t working with an older version of BaseX? • What does string(db:system()//version) return?
Quoted text · France Baril · 86 lines
On Sat, Feb 18, 2017 at 12:27 AM, France Baril <france.baril at architextus.com> wrote: > Maybe my issue is that I am trying to add the comment between elements? > > <html> > <head> > <title>{$dash-cms-name}</title>{(:blah:)} > <meta http-equiv="expires" content="Mon, 22 Jul 2020 11:12:01 > GMT"/> > > > returns > > [XPST0003] Expecting valid expression after curly brace. > > > > On Thu, Feb 2, 2017 at 1:17 PM, Christian Grün <christian.gruen at gmail.com> > wrote: >> >> The following query is a valid XQuery 3.1 expression: >> >> <x>{ (: bla :) }</x> >> >> Do you use an older version of XQuery or BaseX? Are you looking for >> something else_ >> >> >> On Thu, Feb 2, 2017 at 6:48 PM, France Baril >> <france.baril at architextus.com> wrote: >> > Cleaner fake code... A less ugly hack ;-)... >> > >> > On Wed, Feb 1, 2017 at 6:54 PM, Murray, Gregory >> > <gregory.murray at ptsem.edu> >> > wrote: >> >> >> >> Have you tried just an empty sequence? >> >> >> >> {() (: comment... :)} >> >> >> >> >> >> On Feb 1, 2017, at 5:01 PM, France Baril <france.baril at architextus.com> >> >> wrote: >> >> >> >> I was wondering if it would be possible to either: >> >> >> >> * Allow for an omit-comment option in HTML5 serializer >> >> * Allow for {(: Nothing but a comment :)} in xquery code. >> >> >> >> I often have long pieces of HTML to output and clients don't want me to >> >> output them with the result. However, I can't use {(::)}. I have been >> >> using >> >> useless code around my comments just to get around this issue: >> >> >> >> { >> >> >> >> let $t := '' return $t >> >> >> >> (: The comment I can't leave without the bogus code:) >> >> >> >> } >> >> >> >> >> >> Thanks! >> >> >> >> >> >> -- >> >> France Baril >> >> Architecte documentaire / Documentation architect >> >> france.baril at architextus.com >> > >> > >> > >> > >> > -- >> > France Baril >> > Architecte documentaire / Documentation architect >> > france.baril at architextus.com > > > > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com
FB
France Baril18 Feb 2017 20:36 #
Right, I have the issue on an older version. Just tested in a different project that has a newer version and it works. Thanks!
Quoted text · Christian Grün · 99 lines
On Fri, Feb 17, 2017 at 7:28 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Your query works for me (if I define a value for $dash-cms-name, and > if I close the head and html elements). Hm. > > • Are you sure you aren’t working with an older version of BaseX? > • What does string(db:system()//version) return? > > > On Sat, Feb 18, 2017 at 12:27 AM, France Baril > <france.baril at architextus.com> wrote: > > Maybe my issue is that I am trying to add the comment between elements? > > > > <html> > > <head> > > <title>{$dash-cms-name}</title>{(:blah:)} > > <meta http-equiv="expires" content="Mon, 22 Jul 2020 11:12:01 > > GMT"/> > > > > > > returns > > > > [XPST0003] Expecting valid expression after curly brace. > > > > > > > > On Thu, Feb 2, 2017 at 1:17 PM, Christian Grün < > christian.gruen at gmail.com> > > wrote: > >> > >> The following query is a valid XQuery 3.1 expression: > >> > >> <x>{ (: bla :) }</x> > >> > >> Do you use an older version of XQuery or BaseX? Are you looking for > >> something else_ > >> > >> > >> On Thu, Feb 2, 2017 at 6:48 PM, France Baril > >> <france.baril at architextus.com> wrote: > >> > Cleaner fake code... A less ugly hack ;-)... > >> > > >> > On Wed, Feb 1, 2017 at 6:54 PM, Murray, Gregory > >> > <gregory.murray at ptsem.edu> > >> > wrote: > >> >> > >> >> Have you tried just an empty sequence? > >> >> > >> >> {() (: comment... :)} > >> >> > >> >> > >> >> On Feb 1, 2017, at 5:01 PM, France Baril < > france.baril at architextus.com> > >> >> wrote: > >> >> > >> >> I was wondering if it would be possible to either: > >> >> > >> >> * Allow for an omit-comment option in HTML5 serializer > >> >> * Allow for {(: Nothing but a comment :)} in xquery code. > >> >> > >> >> I often have long pieces of HTML to output and clients don't want me > to > >> >> output them with the result. However, I can't use {(::)}. I have been > >> >> using > >> >> useless code around my comments just to get around this issue: > >> >> > >> >> { > >> >> > >> >> let $t := '' return $t > >> >> > >> >> (: The comment I can't leave without the bogus code:) > >> >> > >> >> } > >> >> > >> >> > >> >> Thanks! > >> >> > >> >> > >> >> -- > >> >> France Baril > >> >> Architecte documentaire / Documentation architect > >> >> france.baril at architextus.com > >> > > >> > > >> > > >> > > >> > -- > >> > France Baril > >> > Architecte documentaire / Documentation architect > >> > france.baril at architextus.com > > > > > > > > > > -- > > France Baril > > Architecte documentaire / Documentation architect > > france.baril at architextus.com >
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com

⚡Generated with XQuery