You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am exploring use of this library and found that if there is sub xpath expression, evaluation throws error.
e.g 1:
$(document).xpath("replace(replace('This is the test string','the',''), 'test', 'best')")
throws error
{
Code:"XPTY0004"
message:"Type is not appropriate for the context in which the expression occurs"
}
e.g 2:
$(document).xpath("contcat(concat('a', 'b'),'c')")
throws error
Code:"XPST0017"
message : Expanded QName and number of arguments in a function call do not match the name and arity of a function signature"
The text was updated successfully, but these errors were encountered:
concerning 1 - there is a bug in the implementation: https://github.com/ilinsky/xpath.js/blob/master/src/functions/string.js#L353 , where replace function returns boolean instead of a string (because of a typo)!, hence passing boolean second time in a replace throws error..
concerning 2 - when you correct spelling error: contcat -> concat, the return will be correct.
So, there is generally no problem with nested xpath expressions.
I am exploring use of this library and found that if there is sub xpath expression, evaluation throws error.
e.g 1:
$(document).xpath("replace(replace('This is the test string','the',''), 'test', 'best')")
throws error
{
Code:"XPTY0004"
message:"Type is not appropriate for the context in which the expression occurs"
}
e.g 2:
$(document).xpath("contcat(concat('a', 'b'),'c')")
throws error
Code:"XPST0017"
message : Expanded QName and number of arguments in a function call do not match the name and arity of a function signature"
The text was updated successfully, but these errors were encountered: