Closed amoeba closed 3 years ago
Oh, you know I just saw this in the docstring:
a xml_document object. Or if a file path is provided, the metadata is written out in XML file and the function returns NULL invisibly.
We're not currently doing this so I'll send in a PR.
I'm so used to this that I forget that it might be confusing to new users.
EML::write_xml
returnsNULL
when you save to disk because of the behavior ofemld
'sas_xml
method returns the raw result fromxml2::write_xml
which returnsinvisible()
. One of our team caught this over on https://github.com/NCEAS/datateam-training/issues/229.The relevant code is:
I wasn't sure what the best return type is here. The readr functions, which are common to most users, seem to return the input (to support piping). This method currently returns either an
xml_document
orNULL
. Maybe the best thing is just to wrap thewrite_xml
ininvisible()
and avoid making any big changes to the return type.Thoughts @cboettig?