Which namespace to use for the function fn:parse-xml() in xquery? - exist-db

When I am using fn:parse-xml in existDB getting error as:
Function fn:parse-xml() is not defined in module namespace: http://www.w3.org/2005/xpath-functions
Please help.

For questions, please specify the eXist-db version you are using.
This function has has been added to the code base quite recently in half march 2014 (commit message) and has not been available in a release yet: 2.2RC1 is dated early february 2014.
The function will be available in 2.2RC2 and onwards.

Related

Joomla4: howto create a controller via MVCFactory

I am in the process to cleanup the code of my extensions to fit the requirements for the joomla4 API.
Unfortunately there are no migration documentations available to support this effort. I also could not find any refrences or
implementations with the current joomla4 code. If you look into this code you will find mostly the use of depecated (old) methods.
Also searching the web did not help either. Would be fine if someone could help with some hints - especially with this
topic below:
Create a controller instance version 3.0 API:
$controller = BaseController::getInstance($prefix);
I get a hint for the deprecated "getInstance":
Joomla\CMS\MVC\Controller\BaseController::getInstance(string $prefix, array $config=[]) : static
Deprecated. 5.0 Get the controller through the MVCFactory instead
Unfortunately there are no docs nor any samples how to create my controller via MVCFactory - can somebody help with this issue?

Phpstan Class_parent not found

I am trying to get static PHP code analysis to work on my OXID 6 eshop.
I am, however, hitting a brick wall when it comes to this:
When I run vendor/bin/phpstan analyse --configuration phpstan.neon source/modules/myvendor/mymodule I always get errors like Class mynamespace\Article_parent not found.
This is probably because in Oxid, the eshop classes are not directly overwritten, but instead declared like this
<?php
namespace mynamespace;
class Article extends Article_parent
{
...
and in a metadata.php the overwritten class is defined:
'extend' => [
\OxidEsales\Eshop\Application\Model\Article::class => \mynamespace\Article::class,
],
Phpstan does not seem to be able to resolve this, I've tried many different configuration files, like this one
parameters:
level: max
inferPrivatePropertyTypeFromConstructor: true
autoload_files:
- vendor/oxid-esales/oxideshop-ce/source/oxfunctions.php
- vendor/oxid-esales/oxideshop-ce/source/overridablefunctions.php
or this one
parameters:
level: 7
autoload_files:
- vendor/oxid-esales/testing-library/base.php
- vendor/oxid-esales/oxideshop-ce/source/oxfunctions.php
- vendor/autoload.php
but to no avail.
How can I get phpstan to work?
Please upgrade to the latest PHPStan version 0.12.33.
In version 0.12.26 a lot has been reworked that's described in this article. The main takeaway is that you should no longer get "class not found" for classes that clearly exist without any need for additional configuration.
Also, autoload_files has been deprecated. Please follow Discovering Symbols guide to see what to do instead (you can most likely just delete this section from your configuration).
The \mynamespace\Article_parent class does not exist and will be created at runtime as an alias. This is because it depends on your configuration / other modules installed where this alias points to.
My colleague Alfred Bez created the oxid-dump-autoload tool, what will dump out the module chain based on your current configuration and setup, so that PHPStan / Psalm can find the classes:
https://github.com/alfredbez/oxid-dump-autoload
Hope I could help

How to access extended rule description through web API?

I'm using SonarQube 6.7.6. I try to access extended rule description through web API.
I access a rule which had an extended description through the api/rules/show resource then I look at htmlDesc response field but this field doesn’t contain my extended description.
Does anyone know how to do that?
I quote here the G Ann Campbell answer from SQ community forum:
This is working for me in the latest version.
Speaking of which, 6.7.6 has some age on it at this point. The current version is 8.0 (8.1 to drop any day now) and the current LTS is 7.9.1. You should upgrade at your earliest convenience.
https://community.sonarsource.com/t/how-to-access-extended-rule-description-through-web-api/17500/2

class cSimulation' has no member named 'lastModuleIndex'

I have converted a source code of LEACH protocol which was written in OMNeT 3.3. I converted it to OMNeT 4.5. But I found a error:
class 'cSimulation' has no member named 'lastModuleIndex'
May be lastModuleIndex is deprecated. Could you please tell me the corresponding method in 4.5?
Like you can read at: https://omnetpp.org/doc/omnetpp/api/APIChanges.html
cSimulation changes: lastModuleIndex() renamed to lastModuleId();

Documentation for old versions of Clojure java.jdbc?

The [Using java.jdbc] documentation is very sparse and the clojure.java.jdbc - JDBC-based SQL Interface 0.3.0 API documentation is only for the latest version. [I imagine the title of that last link will change when a new version is released.]
I'm using version 0.2.3 – where can I find the API documentation for that vesion? Or where can I find the info that likely would have been in the API docs for that version?
You can read the docs in the proper tagged branch in GitHub.
Table dropping in your example.
If those docs are not enough you can always refer to the properly tagged source code of that version.
I can use the following commands from a Leiningen REPL to find what seems to be the same info as shown in the API docs to which I linked in my question.
List all keys (sorted) of "... a map of the public intern mappings for the namespace.", i.e. all of the symbols defined and publicly accessible in the namespace:
my-app=>(sort (keys (ns-publics 'clojure.java.jdbc)))
(as-identifier as-key as-keyword as-named-identifier as-named-keyword ...
Show the documentation for a particular symbol:
my-app=>(doc clojure.java.jdbc/drop-table)
-------------------------
clojure.java.jdbc/drop-table
([name])
Drops a table on the open database connection given its name, a string
or keyword
nil

Resources