You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to read or write an XML Attribute using updatecli.
But not finding the value. According to XPath it's a valid query.
Error:
SOURCES
=======
xml
---
ERROR: ✗ cannot find value for path "/a/b/@MyVal" from file "test.xml"
ERROR: ✗ cannot find value for path "/a/b/@MyVal" from file "test.xml"
Pipeline "Test XML" failed
Skipping due to:
sources stage: "cannot find value for path \"/a/b/@MyVal\" from file \"test.xml\""
See further for example files.
Expected Behavior
Source: reads 1 from XML
Target: writes 1 into MyVal of /a/c
Steps To Reproduce
test.xml
<a>
<b MyVal="1">1</b>
<c MyVal="2">2</c>
</a>
updatecli.yaml
name: Test XML
sources:
xml:
name: Read Attribute from XML
kind: xml
spec:
file: test.xml
path: "/a/b/@MyVal"
targets:
xml:
name: Change Attribute in XML
kind: xml
spec:
file: test.xml
path: "/a/c/@MyVal"
run updatecli diff
Environment
- OS: macOS Sonoma 14.4.1
- updatecli: 0.85.0
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Thanks for opening this pull request, Updatecli is currently using the library github.com/beevik/etree and it appears that there is a limitation on the attribute syntax
Thanks for a swift reply, @olblak!
We are trying to change csproj file from dotnet here.
Would it make sense for us to experiment with another XML library? Is this something that could get merged?
Otherwise using shell is probably way to go, right?
Thanks for a swift reply, @olblak!
We are trying to change csproj file from dotnet here.
Would it make sense for us to experiment with another XML library? Is this something that could get merged?
Otherwise using shell is probably way to go, right?
We could use another golang library if you know one, that's something we did for the yaml plugin.
Hey thanks, for sharing that library. I am not familiar with it.
After a quick look, it may be difficult to use for updating xml files versus fetching information from a XML
I'll try to investigate
Is there an existing issue for this?
Current Behavior
I am trying to read or write an XML Attribute using updatecli.
But not finding the value. According to XPath it's a valid query.
Error:
See further for example files.
Expected Behavior
Source: reads 1 from XML
Target: writes 1 into MyVal of /a/c
Steps To Reproduce
test.xml
updatecli.yaml
run
updatecli diff
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: