Re: [R] Failure to understand namespaces in XML::getNodeSet

2017-01-31 Thread Mark Sharp
Hadley, It’s sometimes amazing the mistakes I can make. No, it did not do what I wanted, which was read_xml(str_c(with_ns_xml, collapse = “") Reproducible example follows: library(stringr) library(xml2) ## Given the correct argument value for collapse, the next two lines work no_ns <- read_xml(s

Re: [R] Failure to understand namespaces in XML::getNodeSet

2017-01-31 Thread Hadley Wickham
I think you want x <- read_xml(' http://labkey.org/etl/xml";> MFIA 9-Plex (CharlesRiver) ') The collapse argument do what you think it does. Hadley On Tue, Jan 31, 2017 at 5:36 PM, Mark Sharp wrote: > Hadley, > > Thank you. I am able to get the xml_ns_strip() function to work with my file

Re: [R] Failure to understand namespaces in XML::getNodeSet

2017-01-31 Thread Mark Sharp
Hadley, Thank you. I am able to get the xml_ns_strip() function to work with my file directly so I will likely be able to reach my immediate goal. However, I still have had no success with understanding the namespace problem. I am not able to use read_xml() using the object I generated for the

Re: [R] Failure to understand namespaces in XML::getNodeSet

2017-01-31 Thread Hadley Wickham
See the last example in ?xml2::xml_find_all or use xml2::xml2::xml_ns_strip() Hadley On Tue, Jan 31, 2017 at 9:43 AM, Mark Sharp wrote: > I am trying to read a series of XML files that use a namespace and I have > failed, thus far, to discover the proper syntax. I have a reproducible > example

[R] Failure to understand namespaces in XML::getNodeSet

2017-01-31 Thread Mark Sharp
I am trying to read a series of XML files that use a namespace and I have failed, thus far, to discover the proper syntax. I have a reproducible example below. I have two XML character strings defined: one without a namespace and one with. I show that I can successfully extract the node using th