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

2454: Preserve whitespace in node value when using karate.xmlPath #2496

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

codehackerr
Copy link
Contributor

Description

Thanks for contributing this Pull Request. Make sure that you submit this Pull Request against the develop branch of this repository, add a brief description, and tag the relevant issue(s) and PR(s) below.

  • Relevant Issues : (2454)
  • Relevant PRs : (optional)
  • Type of change :
    • New feature
    • Bug fix for existing feature
    • Code quality improvement
    • Addition or Improvement of tests
    • Addition or Improvement of documentation

@@ -111,6 +111,7 @@ public static Document toXmlDoc(String xml) {
public static Document toXmlDoc(String xml, boolean namespaceAware) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(namespaceAware);
factory.setIgnoringElementContentWhitespace(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false is the default setting. So nothing changes in the current document parsing behavior.
Added the above line to make the behavior explicit.

@ptrthomas
Copy link
Member

will request @bouncysteve to review

Copy link

@bouncysteve bouncysteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done. Thanks for fixing this.

@ptrthomas ptrthomas merged commit 8c57a0d into karatelabs:develop Feb 5, 2024
1 check 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