Jinntec / Fore

Fore - declarative user interfaces in plain HTML
MIT License
80 stars 11 forks source link

custom function failing #279

Open JoernT opened 2 weeks ago

JoernT commented 2 weeks ago
            <fx-function signature="filterProjects($lookup as xs:string, $nodes as element()*) as element()*" type="text/xpath">
                $nodes
            </fx-function>

This multi-param function is failing when being called.

It still work if there's just one argument but as soon as i add the $lookup param it throws an error in evaluateXPathToString.

It's btw independent of which function type to use xpath or javascript - same outcome.

DrRataplan commented 2 weeks ago

What's the function callsite here? The eval to string is actually happening there. We should make a test when we fix the bug.

DrRataplan commented 5 days ago

The signature is filterProjects($lookup as xs:string, $nodes as element()*) as element()* This is parsed with a regex to these parts:

[
    "filterProjects($lookup as xs:string, $nodes as element()",
    "filterProjects($lookup as xs",
    "string, $nodes as element",
    "",
    null
]

which is very wrong.

Regex at registerFunction.js#19 is wrong. I'll pick this up tomorrow!