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

[pkg/ottl] Add GetXML Converter #35462

Merged
merged 3 commits into from
Sep 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix comment
  • Loading branch information
djaglowski committed Sep 27, 2024
commit 46dba44756fb7ec654e58d006c8e55fc6e6e5442
3 changes: 1 addition & 2 deletions pkg/ottl/ottlfuncs/func_get_xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func createGetXMLFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (
return getXML(args.Target, args.XPath), nil
}

// getXML returns a XML formatted string that is a result of removing all matching nodes from the target XML.
// This currently supports removal of elements, attributes, text values, comments, and CharData.
// getXML returns a XML formatted string that is a result of matching elements from the target XML.
func getXML[K any](target ottl.StringGetter[K], xPath string) ottl.ExprFunc[K] {
return func(ctx context.Context, tCtx K) (any, error) {
var doc *xmlquery.Node
Expand Down