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
Consider the following reprex where I have an xml document with multiple nodes of the same element (item):
a<-xml2::as_xml_document("<collection><item>foo</item><item>bar</item></collection>")
b<-xml2::as_list(a)
## This will only show "foo" but not "bar"b$collection$item#> [[1]]#> [1] "foo"## However both elements are there:
names(b$collection)
#> [1] "item" "item"b$collection[[1]]
#> [[1]]#> [1] "foo"b$collection[[2]]
#> [[1]]#> [1] "bar"
When the xml document in the reprex is converted to a list, the list elements will have duplicated names. Which I think is undesirable in R, and will cause all sorts of problems. Would it be possible to either:
Throw a warning when as_list produces duplicated element names; or
Repair the names such that they become unique.
Thanks for considering.
The text was updated successfully, but these errors were encountered:
Thanks for your work on
xml2
!Consider the following reprex where I have an xml document with multiple nodes of the same element (
item
):Created on 2023-12-30 with reprex v2.0.2
When the xml document in the reprex is converted to a
list
, the list elements will have duplicated names. Which I think is undesirable in R, and will cause all sorts of problems. Would it be possible to either:as_list
produces duplicated element names; orThanks for considering.
The text was updated successfully, but these errors were encountered: