8000 add support for connections to `write_xml` · Issue #157 · r-lib/xml2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add support for connections to write_xml #157

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

Closed
lbartnik opened this issue Dec 19, 2016 · 4 comments
8000 Closed

add support for connections to write_xml #157

lbartnik opened this issue Dec 19, 2016 · 4 comments

Comments

@lbartnik
Copy link

write_xml accepts a file path as its second parameter. It could also accept a connection or even a broader list of outputs similar to cat()

@jimhester
Copy link
Member

Sure we would probably accept a pull request implementing this, but I don't think we are going to implement it ourselves. as.character() will get you the text representation in memory if that is what you are after.

@lbartnik
Copy link
Author

Interesting... I suppose it won't do formatting like write_xml(..., format = TRUE) would? I added this bc Hadley asked me. There's a JUnit reporter in testthat that needs to write to stdout() and currently I need to write to a tempfile() before passing to the final stream.

@hadley
Copy link
8000 Member
hadley commented Dec 19, 2016

@jimhester we won't do it for this release, but it might be worthwhile to do next time, just to get more experience writing to connections (which ideally we should support anytime you can pass a filename)

@jimhester
Copy link
Member

@lbartnik As of 0676f71 you can use as.character(..., format = TRUE) and get equivalent formatting to write_xml().

jimhester added a commit to jimhester/xml2 that referenced this issue Dec 20, 2016
This provides full connection support for XML and HTML output using the
xmlSave API (http://xmlsoft.org/html/libxml-xmlsave.html). It also
refactors the file output functions to use the xmlSave API as well,
which provides more formatting and encoding options than the previous
APIs.

Closes r-lib#157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0