Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support asterisk (*) namespaces in xPath expression #103

Open
whati001 opened this issue May 2, 2023 · 0 comments
Open

Support asterisk (*) namespaces in xPath expression #103

whati001 opened this issue May 2, 2023 · 0 comments

Comments

@whati001
Copy link

whati001 commented May 2, 2023

Hi,

would it be possible to add support for asterisk namespaces in the xPath expression?
The goal would be to evaluate the following example:

xPath:

//*:innerField/text() // result: someValue

XML Document:

<xml xmlns:ns2="something" xmlns:ns3="somethingElse">
  <ns2:outerField>
    <ns3:innerField>someValue</ns3:innerField>
  </ns2:outerField>
</xml>

It seems like that the lib supports xPath with NS by using the function xpath.CompileWithNS. However, this requires to define the namespaces explicitly. I would simply like to drop all NS by leveraging the "*:" expression.
To achieve my current goal, I remove all NS manually via string manipulation, but this solution is quite odd.

Regards,
Andi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant