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

Make Xpath accept slightly malformed xml (like html) #1200

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

AlfredBerg
Copy link
Contributor

Currently if the xml that a XPath expression is ran against is not perfectly formatted without any errors or warnings you will get Invalid input XML.. The xmldom package is still able to run XPath expressions even if the XML is not perfectly formatted (like most html documents).

Example:
A simple html document that does not close all tags https://gchq.github.io/CyberChef/#recipe=XPath_expression('//meta','%5C%5Cn')&input=CjwhZG9jdHlwZSBodG1sPgo8aHRtbCBsYW5nPSJlbiI%2BCiAgPGhlYWQ%2BCiAgICA8bWV0YSBjaGFyc2V0PSJ1dGYtOCI%2BCiAgPC9oZWFkPgogIDxib2R5PgogIDwvYm9keT4KPC9odG1sPgo

This pull request makes it so the XPath expression will work in the example.

@CLAassistant
Copy link

CLAassistant commented May 13, 2021

CLA assistant check
All committers have signed the CLA.

@AlfredBerg AlfredBerg changed the title Xpath accept slightly malformed xml (like html) Make Xpath accept slightly malformed xml (like html) May 13, 2021
@a3957273
Copy link
Member

Oh boy is this an old change, but looks good to me! Thanks for the change. :)

@a3957273 a3957273 merged commit 1efbd9d into gchq:master Jun 11, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants