Commit 7f1d2d7
authored
[generator] Fix <remove-attr/> metadata (#999)
Fixes: #976
Given an `api.xml` element like:
<package name='my.package'>
<class name='MyClass' api-since='29' />
</package>
One would expect to be able to remove the `class/@api-since` attribute
with this metadata:
<remove-attr path='/api/package[@name='my.package']/class[@name='MyClass']' name='api-since' />
However, even though `generator` reads the `name` attribute, it then
proceeds to ignore it and remove *all* attributes on the matched node,
resulting in:
<package name='my.package'>
<class />
</package>
This seems unintuitive, and I'm not sure how this could ever be
successfully used in a binding project, since leaving an empty
`<class/>`/etc. node causes `generator` to crash.
Update `<remove-attr/>` to work as expected, removing the named
attribute.1 parent 265ad76 commit 7f1d2d7
File tree
2 files changed
+14
-2
lines changed- src/Java.Interop.Tools.Generator/Metadata
- tests/generator-Tests/Unit-Tests
2 files changed
+14
-2
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
86 | 98 | | |
87 | 99 | | |
88 | 100 | | |
| |||
0 commit comments