inspect:functions#1 on XPath funcs errors out with [XPST0003] and returns an XHTML file
Monday, 6 May 2019 · 3 messages · last reply 16 May 2019
AM
Andreas Mixich6 May 2019 02:47 #
Hi,
opening a new sheet in the GUI I just executed:
inspect:functions("http://www.w3.org/2005/xpath-functions")and this is what I got:
Error:
Stopped at http://www.w3.org/2005/xpath-functions, 1/6:
[XPST0003] Processing instruction has illegal name: xml.
Optimized Query:
inspect:functions("http://www.w3.org/2005/xpath-functions")
The Query itself is, as returned by BaseX, interestingly, an XHTML file, which seems to have been produced via Saxon, here are the first lines:<?xml version="1.0" encoding="UTF-8"?>
<!--XSLT Processor: Saxonica SAXON HE 9.6.0.7-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>XQuery, XPath, and XSLT Functions and Operators Namespace
Document </title>
<meta name="viewport" content="width=device-width, initial-scale=1,
shrink-to-fit=no"/>
<style type="text/css"> </style>
<link rel="stylesheet" type="text/css" href="
http://www.w3.org/StyleSheets/TR/base.css"/>
</head>
<body>
<div class="head">
<p>
<a href="http://www.w3.org/">
<img src="http://www.w3.org/Icons/w3c_home" alt="W3C" height="48"
width="72"/>
</a>
</p>
<h1><a name="title" id="title"/>XQuery, XPath, and XSLT Functions and
Operators Namespace Document </h1>
<h2>21 March 2017</h2>
</div>
<nav id="toc">
<h2><a id="contents"/>Table of Contents </h2>
<ol class="toc">
<li>
<a href="#intro">
<span class="secno">1 </span>
<span class="content">Introduction</span>
</a>
<ol class="toc"/>
</li>And here is the QueryPlan:
Query Plan:
<QueryPlan compiled="true" updating="false">
<InspectFunctions name="inspect:functions" type="(function(*))*">
<Str type="xs:string" size="1">http://www.w3.org/2005/xpath-functions
</Str>
</InspectFunctions>
</QueryPlan>--
Minden jót, all the best, Alles Gute,
Andreas Mixich
MS
Michael Seiferle6 May 2019 11:14 #
Hi Andreas,
I think you are calling the inspect function function on the following HTML Page: https://www.w3.org/2005/xpath-functions/ <https://www.w3.org/2005/xpath-functions/> Per documentation, the function does the following:
Quoted text · Andreas Mixich · 1 line
> If a $uri is specified, the addressed module will be compiled, and its functions will be added to the query context and returned to the user
As the URI contains no XQuery module, the function will error.
Currently
inspect:functions only works on user-defined modules.
Hope this helps!
MichaelQuoted text · Andreas Mixich · 63 lines
> Am 06.05.2019 um 02:47 schrieb Andreas Mixich <mixich.andreas at gmail.com>: > > Hi, > > opening a new sheet in the GUI I just executed: > > inspect:functions("http://www.w3.org/2005/xpath-functions <http://www.w3.org/2005/xpath-functions>") > > and this is what I got: > > Error: > Stopped at http://www.w3.org/2005/xpath-functions <http://www.w3.org/2005/xpath-functions>, 1/6: > [XPST0003] Processing instruction has illegal name: xml. > > Optimized Query: > inspect:functions("http://www.w3.org/2005/xpath-functions <http://www.w3.org/2005/xpath-functions>") > > The Query itself is, as returned by BaseX, interestingly, an XHTML file, which seems to have been produced via Saxon, here are the first lines: > > <?xml version="1.0" encoding="UTF-8"?> > <!--XSLT Processor: Saxonica SAXON HE 9.6.0.7--> > <html xmlns="http://www.w3.org/1999/xhtml <http://www.w3.org/1999/xhtml>" lang="EN"> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> > <title>XQuery, XPath, and XSLT Functions and Operators Namespace Document </title> > <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/> > <style type="text/css"> </style> > <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/base.css <http://www.w3.org/StyleSheets/TR/base.css>"/> > </head> > <body> > <div class="head"> > <p> > <a href="http://www.w3.org/ <http://www.w3.org/>"> > <img src="http://www.w3.org/Icons/w3c_home <http://www.w3.org/Icons/w3c_home>" alt="W3C" height="48" width="72"/> > </a> > </p> > <h1><a name="title" id="title"/>XQuery, XPath, and XSLT Functions and Operators Namespace Document </h1> > <h2>21 March 2017</h2> > </div> > <nav id="toc"> > <h2><a id="contents"/>Table of Contents </h2> > <ol class="toc"> > <li> > <a href="#intro"> > <span class="secno">1 </span> > <span class="content">Introduction</span> > </a> > <ol class="toc"/> > </li> > > > And here is the QueryPlan: > > Query Plan: > <QueryPlan compiled="true" updating="false"> > <InspectFunctions name="inspect:functions" type="(function(*))*"> > <Str type="xs:string" size="1">http://www.w3.org/2005/xpath-functions <http://www.w3.org/2005/xpath-functions></Str> > </InspectFunctions> > </QueryPlan> > > -- > Minden jót, all the best, Alles Gute, > Andreas Mixich
AM
Andreas Mixich16 May 2019 20:03 #
Quoted text · Michael Seiferle · 5 lines
On Mon, May 6, 2019 at 11:14 AM Michael Seiferle <ms at basex.org> wrote: > As the URI contains no XQuery module, the function will error. > > Currently inspect:functions only works on user-defined modules. >
Sorry for late reply, I am surrounded by work. Thanks for clarifying.
--
Minden jót, all the best, Alles Gute,
Andreas Mixich
Written for BaseX 9.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery