Kong / Kong/insomnia

[Bug] Unable to add colon to XPath queries

Open
#1,769 4 comments 5 reactions 0 assignees View on GitHub
B-bug S-verified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

**Description**
While receiving an XML response and attempting to filter the response using XPath, if the path contains a colon inside of it, "Invalid XPath query" error will be thrown, although it is a valid path, for example _//s:path_

**Example**
The following response is impossible to query:


If now I will query the following:
//s:Envelope
I will get the Invalid XPath query error.

**Info**
According to the XPath 3.1 documentation and according to various desktop and online XML editors it is a valid query.
Though from what I understand, the [npm package](https://www.npmjs.com/package/xpath) xpath is using XPath1.0, might that be the issue?

Contributor guide

Open the contributing guide

Research direction

Start by locating the response-filtering code that validates XPath queries and reproduce the reported //s:Envelope case using the npm xpath dependency. Done means a valid namespaced XPath no longer raises “Invalid XPath query”; run the relevant test suite and add coverage if the project has tests for this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.