Re: [Xsltforms-support] Parsing error in XSLTForms 1.7
Brought to you by:
alain-couthures
|
From: Alain C. <ala...@ag...> - 2023-04-04 16:06:57
|
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
Hi Winona,
</div>
<div class="default-style">
</div>
<div class="default-style">
Since version 1.5, there is a new XPath parser written in Javascript.
</div>
<div class="default-style">
</div>
<div class="default-style">
There is a bug in it when there is a wildcard for prefix between an axis and a local name (in this error: "descendant::*:editionStmt").
</div>
<div class="default-style">
</div>
<div class="default-style">
As a workaround, if you replace "/descendant::* with "//", such expressions should be parsed correctly.
</div>
<div class="default-style">
</div>
<div class="default-style">
I already have a fix for this bug which will be integrated in the next release.
</div>
<div class="default-style">
</div>
<div class="default-style">
Please also find how to patch yourself the "xsltforms.js" file within the "Fleur.XPathEvaluator._getName" function:
</div>
<div class="default-style">
...
</div>
<div class="default-style">
Fleur.XPathEvaluator._getName = function(s) {
<br> var i = 0;
<br> var o = s.charAt(0);
<br> var prev = "";
<br> while (o !== "" && "_.-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz:*{".indexOf(o) !== -1) {
<br><strong> if (o === "*") {</strong>
<br><strong> if (s.charAt(i + 1) !== ":") {</strong>
<br><strong> if (i > 0 && (s.charAt(i - 1) === ":" || s.charAt(i - 1) === "}")) {</strong>
<br><strong> i++;</strong>
<br><strong> break;</strong>
<br><strong> } else {</strong>
<br><strong> if (i === 0) {</strong>
<br><strong> i++;</strong>
<br><strong> }</strong>
<br><strong> break;</strong>
<br><strong> }</strong>
<br><strong> }</strong>
<br><strong> }</strong>
</div>
<div class="default-style">
...
</div>
<div class="default-style">
<div class="default-style">
</div>
<div class="default-style">
Thank you for your feedback!
</div>
<div class="default-style">
</div>
<div class="default-style">
--Alain
</div>
</div>
<blockquote type="cite">
<div>
Le 04/04/2023 15:52 CEST, Winona Salesky <wsa...@gm...> a écrit :
</div>
<div>
</div>
<div>
</div>
<div dir="ltr">
Hi All,
<div>
I just got around to testing version 1.7. My forms which were working in version 1.3 are now throwing the following error. Any ideas what is going on?
</div>
<div>
Thanks!
<br>
<div>
-Winona
</div>
<div>
</div>
<div>
ERROR:
</div>
<div>
<span style="font-family: monospace;">XSLTForms Exception<br><br>Error parsing the following XPath expression<br>instance('i-porjectSpecificData')//*:option[@name= instance('i-projectSpecificDataSelected')//*:selected]/descendant::*:editionStmt<br><br>Unexpected identifier 'syntax'</span>
</div>
</div>
</div> _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support
</blockquote>
</body>
</html>
|