mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
[PR #398] [MERGED] Feature/xpath transformer #893
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/wiremock/WireMock.Net/pull/398
Author: @kashifsoofi
Created: 1/8/2020
Status: ✅ Merged
Merged: 1/9/2020
Merged by: @StefH
Base:
master← Head:feature/xpath_transformer📝 Commits (3)
9fa5a12XPath transformer, added handlerbars helper to select nodes using xpath and setting the outerxml value in response65da52aAdded test to select attribute value and node text59a65e7Removed extra empty lines📊 Changes
3 files changed (+270 additions, -0 deletions)
View changed files
📝
src/WireMock.Net/Transformers/HandleBarsHelpers.cs(+2 -0)➕
src/WireMock.Net/Transformers/HandleBarsXPath.cs(+102 -0)➕
test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXPathTests.cs(+166 -0)📄 Description
Fixes #397 Added feature to select values from xml using XPath.
Implemented following as suggested
XPath.SelectSingleNodeXPath.SelectNodesAlso implemented
XPath.EvaluateReason for using OuterXml in
HandleBarsXPath.csis as follows but happy to change :Testing
with
/todo-list/todo-item[1]results in<todo-item id="a1">abc</todo-item>using https://www.freeformatter.com/xpath-tester.html. I think it is the correct behaviour as to select text I would provide
/todo-list/todo-item[1]/text(). However same experssion return only the text using XPath2SelectSingleNode.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.