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

Comment nodes? #111

Closed
jimhester opened this Issue Jul 7, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@jimhester
Member

jimhester commented Jul 7, 2016

Not sure these are possible to add either currently...

@jimhester

This comment has been minimized.

Member

jimhester commented Dec 8, 2016

Now possible

library(xml2)
library(magrittr)
d <- xml_new_document() %>%
  xml_add_child('style', type='text/css') %>%
  xml_add_child(xml_comment('Hello!')) %>%
  xml_root()
as.character(d)
#> [1] "<?xml version=\"1.0\"?>\n<style type=\"text/css\"><!--Hello!--></style>\n"

@jimhester jimhester closed this in 7ae3208 Dec 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment