sax

C++ sax2 parser problem

假装没事ソ 提交于 2019-12-24 14:26:27
问题 I want to parse an XML file. My XML looks like this: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>tracker</name> <value>localhost:58303</value> <description>The host and port that the MapReduce job tracker runs at. If "local", then jobs are run in-process as a single map and reduce task. </description> </property> </configuration> I use the sxx 2 parser to parse

Android XML parser for simple xml node strings

我是研究僧i 提交于 2019-12-24 11:08:50
问题 I need to parse a series of simple XML nodes (String format) as they arrive from a persistent socket connection. Is a custom Android SAX parser really the best way? It seams slightly overkill to do it in this way I had naively hoped I could cast the strings to XML then reference the names / attributes with dot syntax or similar. 回答1: I'd use the DOM Parser. It isn't as efficient as SAX, but if it's a simple XML file that's not too large, it's the easiest way to get up and moving. Great

SAX Parser doesn't recognize windows-1255 encoding

孤街醉人 提交于 2019-12-24 10:55:54
问题 I'm working on a rss parser in android (upgrading a parser I found on the internet). From what I know SAX Parser recognize the encoding automatically from the xml tag, but when I try to parse a feed that declare windows-1255 encoding it doesn't parsing it and throws and exception. I tried few things: final InputSource source = new InputSource(feed); Reader isr = new InputStreamReader(feed); source.setCharacterStream(isr); I even tried telling him the specific encoding. source.setEncoding(

java.lang.NoClassDefFoundError: org/saxpath/SAXPathException

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 07:40:00
问题 In my app, in runtime I was getting java.lang.NoClassDefFoundError: org/jaxen/NamespaceContext So after looking into this thread I added dom4j.jar and jaxen.jar to my classpath using maven: <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>full</version> </dependency> After dong that I have encountered a differnt exception: java.lang.NoClassDefFoundError: org

Using Sax parsing to edit and write XML in VB6

社会主义新天地 提交于 2019-12-24 01:00:00
问题 So I am trying to edit an xml (output is an xml) using SAX parsing in VB6 (for an ancient COM component). I would prefer to use DOM parsing but the size of the xml (over 20MB's potentially) forces me to use SAX. I am relatively new to VB6 and I have no experience in SAX parsing. I have looked around online but even the best resource I have found (http://www.developerfusion.com/article/84405/sax-and-vb-6/) gives me little insight into how to combine grandchilren tags with existing attributes

Merge cells in Excel using “Openxml writer”

自闭症网瘾萝莉.ら 提交于 2019-12-23 23:06:04
问题 I want to merge cells is excel. By using DOM approach I can do it easily. But as my excel file is too large, when I tries to get worksheet it throws Out of memory exception. So I have to use SAX approach to read excel file. But I dont know how to merge cells in this approach. Searched a lot but every one gives the solution of DOM approach. Can anyone help, Thanks in advance. 回答1: My solution is: read the whole data from the old sheet by openxmlreader than write into new sheet by openxmlwriter

Java XMLReader not clearing multi-byte UTF-8 encoded attributes

老子叫甜甜 提交于 2019-12-23 10:06:50
问题 I've got a really strange situation where my SAX ContentHandler is being handed bad Attributes by XMLReader. The document being parsed is UTF-8 with multi-byte characters inside XML attributes. What appears to happen is that these attributes are being accumulated each time my handler is called. So rather than being passed in succession, they get concatenated onto the previous node's value. Here is an example which demonstrates this using public data (Wikipedia). public class MyContentHandler

Java XMLReader not clearing multi-byte UTF-8 encoded attributes

China☆狼群 提交于 2019-12-23 10:05:43
问题 I've got a really strange situation where my SAX ContentHandler is being handed bad Attributes by XMLReader. The document being parsed is UTF-8 with multi-byte characters inside XML attributes. What appears to happen is that these attributes are being accumulated each time my handler is called. So rather than being passed in succession, they get concatenated onto the previous node's value. Here is an example which demonstrates this using public data (Wikipedia). public class MyContentHandler

python sax error “junk after document element”

﹥>﹥吖頭↗ 提交于 2019-12-23 09:05:42
问题 I use python sax to parse xml file. The xml file is actually a combination of multiple xml files. It looks like as follows: <row name="abc" age="40" body="blalalala..." creationdate="03/10/10" /> <row name="bcd" age="50" body="blalalala..." creationdate="03/10/09" /> My python code is in the following. It show "junk after document element" error. Any good idea to solve this problem. Thanks. from xml.sax.handler import ContentHandler from xml.sax import make_parser,SAXException import sys

Using SAX Parser to get several sub-nodes?

最后都变了- 提交于 2019-12-23 04:38:18
问题 I have a large local XML file (24 GB) with a structure like this: <id>****</id> <url> ****</url> (several times within an id...) I need a result like this: id1;url1 id1;url2 id1;url3 id2;url4 .... I wanted to use Nokigiri either with the SAX Parser or the Reader since I can't load the whole file into memory. I am using a Ruby Rake task to execute the code. My code with SAX is: task :fetch_saxxml => :environment do require 'nokogiri' require 'open-uri' class MyDocument < Nokogiri::XML::SAX: