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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creation and mutation of elements, attrs etc #9

Closed
hadley opened this Issue Feb 20, 2015 · 13 comments

Comments

Projects
None yet
@hadley
Member

hadley commented Feb 20, 2015

If you need this, please 馃憤 this issue with a brief use case

@jread-usgs

This comment has been minimized.

jread-usgs commented Feb 27, 2015

馃憤 I would use this to 1) build xml for POSTs 2) modify svg elements or programmatically build interactive svgs.

@jennybc

This comment has been minimized.

Member

jennybc commented Mar 20, 2015

馃憤 In googlesheets, which wraps the Google Sheets API, we have a function to edit cells in the sheet. The workflow is this: fetch the current cell contents, then edit specific values in the XML, send back via POST. Right now we're using the XML package but I'd rather be using this package.

@jennybc

This comment has been minimized.

Member

jennybc commented Mar 21, 2015

My first use case was of creating XML sort of de novo. I just found another one that's more of a true mutate. And our current workflow is to just use regex substitution 馃槼 If this were easier in one of the XML packages, like yours, I'd much prefer to do that.

@timelyportfolio

This comment has been minimized.

timelyportfolio commented Apr 8, 2015

馃憤 I do this all the time especially with SVG from gridSVG and dev.svg where I might change height, width, viewBox, style attributes. Also, I'm trying to work through a solution namespacing the ids of letters/text from dev.svg in the case where there are multiple separately rendered graphics on the page.

@sjp

This comment has been minimized.

Contributor

sjp commented Apr 13, 2015

To add to what @timelyportfolio mentioned, it would be nice to be able to build up an image in gridSVG using something other than XML. I suspect that xml2 could greatly improve the performance of SVG image generation.

Additionally, I've been making changes to selectr so that it has plugin packages for XML and xml2. Supporting creation/mutation would be useful because the plugin packages might be good for manipulating scraped data. The same applies for rvest.

@npjc

This comment has been minimized.

Contributor

npjc commented May 9, 2015

馃憤

  • I've done all sorts of crazyness playing with R-bindings of Snap.svg. when it doesn't explode it's very powerful!
@npjc

This comment has been minimized.

Contributor

npjc commented May 10, 2015

Say you want to take this vignette and modify/enhance it so that when you hover over each function it displays the function's Arguments documentation (so that if past you has been less explicit than present you would like you can make sense of what's what without having to open up your IDE).

  • functions are wrapped with a <span> of class kw
  • create a related <table> element that contains the Arguments and their explanation
  • default this element with a style such that it is hidden
  • add :hover style behaviour to reveal!

if you could...

h_con <- 'http://cran.r-project.org/web/packages/dplyr/vignettes/data_frames.html'
modified_html <- h_con %>% read_html() %>%  ...

where ... is some combination of ?

node_select() # == rvest::html_node() 
nodes_select() # == rvest::html_nodes() 
node_mutate()
nodes_mutate()
nodes_create()
... and friends?
@cdiener

This comment has been minimized.

cdiener commented Oct 21, 2015

馃憤

We use xml2 to handle biochemical reaction models for Systems Biology described in SBML (http://sbml.org). Writing those models to disk is kind of crucial for reproducible research so it would be nice feature avoid writing all the tags etc. by hand.

@renkun-ken

This comment has been minimized.

Contributor

renkun-ken commented Oct 22, 2015

My use case is to batch create a group of xml configurations to deploy to server programs. The xml contains some nodes with simple structure just like typical configuration files.

@cboettig

This comment has been minimized.

cboettig commented Oct 26, 2015

馃憤 I'm working on several packages designed to assist researchers both consume and publish datasets with XML-based metadata standards (e.g. EML, NeXML). The basic idea is that it's much easier to discover interesting datasets when you can search a big pool of them over interesting metadata fields. The data repository managers have made fancy tools to do the search and discovery, but pretty much no one wants to write up their metadata in XML. Such R packages would let users turn nice familiar R structures into the required XML easily; complementing the current use case of xml2 as a way to turn XML data into nice R structures. This helps researchers share & organize their own data according to existing standards, rather than just be consumers.

@jennybc

This comment has been minimized.

Member

jennybc commented Oct 26, 2015

Just recording something already conveyed via email ...

An xml2 option for XML creation and mutation would be a welcome improvement over XML, specifically in terms of better handling of encoding.

And, for that matter, hopefully xml2 would also make it easier to finesse namespaces when creating XML (see e.g. this SO thread).

@imanuelcostigan

This comment has been minimized.

imanuelcostigan commented Apr 8, 2016

Use case for me: reading in XML file containing market data, modifying values and attributes to represent "simulated" market data and write modified XML back out for use by another system

@jimhester

This comment has been minimized.

Member

jimhester commented May 20, 2016

Closed by #76

@jimhester jimhester closed this May 20, 2016

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