xml-parsing

Reading KML files into R

情到浓时终转凉″ 提交于 2019-12-09 03:22:59
问题 I'm building a workflow for reading multiple-geometry KML files into R. This is my working map, with point and path geometries. The (reproducible) R script is: library(rgdal) setwd( {SPECIFY A FOLDER} ) download.file("http://www.scribblemaps.com/maps/kml/shackleton.kml", "file.kml") (lyr = ogrListLayers("file.kml")) map = readOGR ("file.kml", layer=lyr, verbose = TRUE, drop_unsupported_fields=T, dropNULLGeometries=T) which fails with: Error in ogrInfo(dsn = dsn, layer = layer, encoding =

Parsing small web page with xml2 throws XML_PARSE_HUGE error

て烟熏妆下的殇ゞ 提交于 2019-12-09 03:09:29
Recently a user of my rNOMADS package in R began getting unexpected errors: Error: Excessive depth in document: 256 use XML_PARSE_HUGE option [1] We tracked the issue down to this command: html.tmp <- xml2::read_html("http://nomads.ncep.noaa.gov/cgi-bin/filter_rap.pl?dir=%2Frap.20151120") Upon following the link, it appears that the web page to be parsed is no larger than other ones that work fine, and much less than the 1 megabyte limit that should require the XML_PARSE_HUGE option. Furthermore, xml2::read_html actually has no XML_PARSE_HUGE option anyway. The only other potential solution,

Using jena for creating RDF from XMl file [duplicate]

橙三吉。 提交于 2019-12-09 01:16:27
This question already has answers here : Closed 7 years ago . Possible Duplicate: create RDF from XML I am sorry for asking this question for the second time, I am still still having problem in generating rdf from the following xml file. <xml> <person> <name>Joe</name> <website url="www.example1.com">contact1</website > <vote>20</vote> </person> <person> <name>Anna</name> <website url="www.example2.com">contact2</website> <vote>80</vote> </person> </xml> I think using jena might solve the issue , but I am not sure how to do so, since each has got three properties and I would like the out put

Unstructured XML via non-tab deliminator?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 23:34:14
问题 We have a complex XML Structure and really a big one (>500 MB). the XSD of the structure is: This XSD As we know this is a complex one. and because of size or non-tab deliminator structure, I couldn't convert it to a readable better presentation. I want to read this file via C# and search the drug name. what is wrong via my code? try { XmlReader xmlFile; xmlFile = XmlReader.Create("C:\\Users\\Dr\\Desktop\\full database.xml", new XmlReaderSettings()); DataSet ds = new DataSet(); ds.ReadXml

XmlPullAttributes cannot be cast to XmlBlockParser

笑着哭i 提交于 2019-12-08 21:22:33
问题 Custom xml file to view This is an error produced from the above question I managed to get the XML file saved into the assets folder, and loaded (and I can even navigate through the different parts of the parser and produce outputs from them) but when I try to pass the XmlPullParser to LayoutInflater I get the above error. I am not totally sure why it is happening though. Below is the activity that I am using (the part of it that involves parsing the Xml file) as well as the xml file (called

How to play online radio streaming url in Android. How to play .pls radio streaming url in android

时光毁灭记忆、已成空白 提交于 2019-12-08 20:50:23
问题 I created a XML file in my server. It contains title and link tags. I fetch the tags and display them as links in ListView . From there when the user clicks the link, then I'd like play the .pls file in the Radio Station app. Here is my XML file: <item> <title> Kushi FM </title> <link>http://108.163.197.114:8071/listen.pls</link> </item> I don't know how to play the link in next activity. MainActivity : public class MainActivity extends AppCompatActivity { // All static variables static final

Getting PHP's XMLReader to not throw php errors in invalid documents

筅森魡賤 提交于 2019-12-08 20:33:37
问题 I'm in the process of writing a parser, and trying to do good error handling with exceptions. The following sample code: <?php $xml = <<<XML <?xml version="1.0"?> <rootElem> XML; $reader = new XMLReader(); $reader->xml($xml, null, LIBXML_NOERROR | LIBXML_NOWARNING); $reader->read(); Emits: PHP Warning: XMLReader::read(): An Error Occured while reading in /Users/evert/code/xml/errortest.php on line 11 PHP Stack trace: PHP 1. {main}() /Users/evert/code/xml/errortest.php:0 PHP 2. XMLReader->read

Parsing XML File with Boost C++

你离开我真会死。 提交于 2019-12-08 17:29:46
I have to parse one xml file using boost c++, I have written one test code which is working for this xml. a.xml <a> <modules> <module>abc</module> <module>def</module> <module>ghi</module> </modules> </a> Output is coming abc def ghi but for this a.xml file, my test code is not showing any output, 3 blank lines are coming as output. <a> <modules> <module value = "abc"/> <module value = "def"/> <module value = "abc"/> </modules> </a> here is the test code: #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/xml_parser.hpp> #include <boost/foreach.hpp> #include <iostream> int

Groovy XmlSlurper access attribute value in root node

心已入冬 提交于 2019-12-08 15:42:40
问题 I'm trying to accomplish accessing the attributes that are part of the root node using Groovy and XmlSlurper. I can do this easily with nested nodes, but can't seem to access the root node. Here is the XML structure (simplified): <coverage lines-covered="2353" lines-valid="2943"> <sources /> <packages /> </coverage> I'd like to be able to get to the lines-covered and lines-valid attribute values. Here is the code I'm trying out: def cobertura = new XmlSlurper().parse(xml) def coverage =

How to avoid creating non-significant white space text nodes when creating a `Nokogiri::XML` or `Nokogiri::HTML` object

Deadly 提交于 2019-12-08 15:34:45
问题 While parsing an indented XML, non-significant white space text nodes are created from the white spaces between a closing and an opening tag. For example, from the following XML: <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> whose string representation is as follows, "<note>\n <to>Tove</to>\n <from>Jani</from>\n <heading>Reminder</heading>\n <body>Don't forget me this weekend!</body>\n</note>\n" the following Document is