[basex-talk] Problem with attribute parsing?

2020-04-05 Thread Peter Villadsen
Hello

I was doing some experiments and I ended up with this:

let $c := 
return $c/@Source

When this is compiled in the BaseX GUI app, an error message ensues:

Error:
Stopped at ... /file3, 1/30:
[XPST0003] Expecting '}', found '''.
Query:
let $c :=  return $c/@Source
Query plan:


Surely that is not correct? If I add a } there, everything is fine:

let $c := 
return $c/@Source

I don't think there is an XML requirement forcing escaping start brace ('{') 
inside an attribute value? I know that XQuery supports  where 
the inside of the {} is evaluated to give the value for the A attribute, but 
the example above is not XQuery, just an XML literal.

I am sure I would have noticed this if it were a general problem.

Best Regards

Peter Villadsen
Principal Architect
Microsoft Business Applications Group



Re: [basex-talk] Problem with attribute parsing?

2020-04-05 Thread Liam R. E. Quin
On Sun, 2020-04-05 at 22:21 +, Peter Villadsen wrote:
> Hello
> 
> I was doing some experiments and I ended up with this:
> 
> let $c := 

This is an error because the braces surround expresions:
  
would work.

Similarly you can write
   { concat('dirt', 'noise') }
of course.

Liam

-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org



Re: [basex-talk] Memoize

2020-04-05 Thread Mickael Desfrenes
That's great, just what I was looking for. And the rest of the presentation is 
interesting too. 

Thank you ! 


De: "Andreas Mixich"  
Cc: "basex-talk"  
Envoyé: Samedi 4 Avril 2020 02:55:45 
Objet: Re: [basex-talk] Memoize 

Not sure, whether this went through to the mailing list or only to Mickael, so 
please, forgive me, if posting twice. 
On Mon, Mar 23, 2020 at 11:05 AM Mickael Desfrenes < [ 
mailto:mickael.desfre...@unicaen.fr | mickael.desfre...@unicaen.fr ] > wrote: 



Is there any known solution for function memoization in basex ? Or maybe a 
cache implementation ? 



Not sure how much this helps, but there was a Balisage talk by James Fuller, 
titled [ 
https://www.balisage.net/Proceedings/vol17/author-pkg/Fuller01/BalisageVol17-Fuller01.html
 | "A catalog of Functional Programming idioms in XQuery 3.1" ] , which 
produces (amongst others) a memoize function. It is written in the Marklogic 
dialect of XQuery. but porting it was a no-brainer, since, AFAIR, only the 
syntax for maps had to be changed. The [ 
https://github.com/xquery/xquery_functional_catalog/ | Github repo is here ] . 
-- 
Minden jót, all the best, Alles Gute, 
Andreas Mixich