Re: [basex-talk] hickup in typeswitch
Hi Rob, no - this is no bug, as a map *is* a (special kind) of function. Compare http://www.w3.org/TR/xquery-31/#id-maps ;[Definition: A map is a function that associates a set of keys with values, resulting in a collection of key / value pairs.] In other words, the expression map{'p':'test'} instance of function(*) MUST yield true, as it does in BaseX, as it does with Saxon. Kind regards,Hans-Jürgen Rob Stapper r.stap...@lijbrandt.nl schrieb am 14:51 Samstag, 25.Juli 2015: !--#yiv2659884181 _filtered #yiv2659884181 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv2659884181 #yiv2659884181 p.yiv2659884181MsoNormal, #yiv2659884181 li.yiv2659884181MsoNormal, #yiv2659884181 div.yiv2659884181MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:Calibri, sans-serif;}#yiv2659884181 a:link, #yiv2659884181 span.yiv2659884181MsoHyperlink {color:blue;text-decoration:underline;}#yiv2659884181 a:visited, #yiv2659884181 span.yiv2659884181MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv2659884181 span.yiv2659884181E-mailStijl17 {font-family:Calibri, sans-serif;color:windowtext;}#yiv2659884181 .yiv2659884181MsoChpDefault {font-family:Calibri, sans-serif;} _filtered #yiv2659884181 {margin:70.85pt 70.85pt 70.85pt 70.85pt;}#yiv2659884181 div.yiv2659884181WordSection1 {}--Hi, I encountered a little but nasty to find hick-up in the typeswitch command.One would expect the code below to return: “map”.It returns: “function”.Looks like a bug to me. typeswitch( map { 'p' : 'test'})case function(*) return 'function'case map(*) return 'map'default return 'other' Rob Stapper | | Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. www.avast.com |
Re: [basex-talk] hickup in typeswitch
Hi Hans-Juergen, Thank you for the explanation and link. I wasn’t aware of that. So an item should always first be checked for map-type before checking it for function-type. Learning new thing in the weekend. Thanx, Rob PS. Same there for arrays too, as I read now. Van: Hans-Juergen Rennau [mailto:hren...@yahoo.de] Verzonden: zaterdag 25 juli 2015 15:42 Aan: Rob Stapper; BaseX Onderwerp: Re: [basex-talk] hickup in typeswitch Hi Rob, no - this is no bug, as a map *is* a (special kind) of function. Compare http://www.w3.org/TR/xquery-31/#id-maps ; [Definition: A map is a function that associates a set of keys with values, resulting in a collection of key / value pairs.] In other words, the expression map{'p':'test'} instance of function(*) MUST yield true, as it does in BaseX, as it does with Saxon. Kind regards, Hans-Jürgen Rob Stapper r.stap...@lijbrandt.nl schrieb am 14:51 Samstag, 25.Juli 2015: Hi, I encountered a little but nasty to find hick-up in the typeswitch command. One would expect the code below to return: “map”. It returns: “function”. Looks like a bug to me. typeswitch( map { 'p' : 'test'}) case function(*) return 'function' case map(*) return 'map' default return 'other' Rob Stapper _ https://www.avast.com/antivirus Afbeelding verwijderd door afzender. Avast logo Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. www.avast.com https://www.avast.com/antivirus --- Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. https://www.avast.com/antivirus
[basex-talk] Custom URI resolver
Hello, I want to import a XSL transformation into another by name as it is already possible with XQuery modules - a pitty that this doesn't work with XSL transformations imported via expath package. Furthermore I want to restrict file system access in XSL transformations and xqueries. As far as I understand it to do both I need to define a custom URI resolver - Please tell me if there is a better way. Thus my question is: How can I register a central URI resolver to be used by both XSLT and XQuery? I work with BaseX 8.2.3 and Saxon-HE 9.6.0-6 directly with Context and LocalSession objects in Java. I've read http://docs.basex.org/wiki/Catalog_Resolver and registered a catalog file via SET CATFILE but it doesn't seem to be used in XSL transformations. I've also tried it with Apache XML resolver in the classpath. For Saxon I tried to register the CatalogResolver explicitly by setting the system property http://saxon.sf.net/feature/uriResolverClass to org.apache.xml.resolver.tools.CatalogResolver and writing a CatalogManager.properties file without effect. What is missing? Please help! Best regards, Max
[basex-talk] hickup in typeswitch
Hi, I encountered a little but nasty to find hick-up in the typeswitch command. One would expect the code below to return: map. It returns: function. Looks like a bug to me. typeswitch( map { 'p' : 'test'}) case function(*) return 'function' case map(*) return 'map' default return 'other' Rob Stapper --- Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. https://www.avast.com/antivirus