-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Description
Dear all,
Thanks for your great package, it has helped me a lot!.
I don't know if this is the place to ask you, but after upgrading to version R 4.0.0, the write_xml function no longer works. Returns NULL without writing any xml files.
Thank you very much for any information you can provide to this macOS user.
x <- read_xml("<body>
<p>Some <b>text</b>.</p>
<p>Some <b>other</b> <b>text</b>.</p>
<p>No bold here!</p>
</body>")
# Get only words in bold
boldWords <- xml_find_all(x, ".//b")
# Add each node in nodeset to a new document
boldDocument = xml_new_root('newBody')
for (child in boldWords) {
xml_add_child(boldDocument, child, 'newBody')
}
# Save subset xml in a new file
tmp = tempfile(fileext = ".xml")
write_xml(boldDocument, file = tmp, options = 'as_xml')
Metadata
Metadata
Assignees
Labels
No labels