Questions tagged [sax]

SAX stands for Simple API for XML, and is an event-based way of reading XML data from a document.

SAX (Simple API for XML) is an event-based sequential access parser API developed by the XML-DEV mailing list for XML documents.
SAX provides a mechanism for reading data from an XML document that is an alternative to that provided by the Document Object Model (DOM). Where the DOM operates on the document as a whole, SAX parsers operate on each piece of the XML document sequentially.

XML processing with SAX

A parser that implements SAX (i.e., a SAX Parser) functions as a stream parser, with an event-driven API. The user defines a number of callback methods that will be called when events occur during parsing. The SAX events include (among others):

Useful references:

1784 questions
0
votes
0 answers

Fast XML-Parsing on Android

I've written a XML-Parser in Java using the SAXParserFactory (Code below). On my laptop it needs <1 second, but on my Android phone (S3 mini) it takes around 30seconds for the same file. It parses a list of collectible cards. The xml-File is ~5MB…
Lars
  • 1
0
votes
1 answer

Join two strings retrieved by SAX

I have an XML file like this one:
Java-SAX Tutorial Yong Mook
user1885868
  • 1,063
  • 3
  • 17
  • 31
0
votes
2 answers

Libcurl + rapidjson for Streaming Deserialization?

I have been tearing my hair out (not much to begin with, though), trying to figure out a way to hit a web service and then parse and deserialize the json in chunks while parsing at the same time into into my objects without storing the entire…
user3072517
  • 513
  • 1
  • 7
  • 21
0
votes
1 answer

POI SAX Date data type

I'm trying to get date data types from an excel file, but the output when he's reading is 41306.038888888892. This value just appear for date, is there any way to get the normal date? I did not find anything searching in the web. Hope someone can…
Lucas Rodrigues
  • 139
  • 3
  • 13
0
votes
2 answers

How to convert xpath to java code

I have a xpath of an element and need to write a java code which gives me exactly the same element as an object. I believe i need to use SAX or DOM ? i m totally newbie.. xpath…
Akin Dönmez
  • 353
  • 8
  • 24
0
votes
1 answer

Indent XML in JEditorPane

I am trying to indent XML in a Java JEditorPane, so that this: becomes: I have tried constructing a DocumentBuilder object, and then transforming it…
eeijlar
  • 1,232
  • 3
  • 20
  • 53
0
votes
0 answers

sax parser throws FileNotFound after exchanging characters in file name

I am trying to parse a file with a ^ in the file name. The problem is that after passing it to the parser, it changes the ^ to a %5, resulting in the file not being found. Is there a sax feature or property I can set so the ^ is not…
Steve
  • 11
  • 2
0
votes
1 answer

Split an XML file by element using Smooks or whatever

I'm trying to do something which I consider a basic task here. I'm after a simple and tidy Java solution that can split XML content by element. I don't want to load the whole content in memory (i.e. I want to stream the elements) and I want to get…
Guido
  • 341
  • 5
  • 18
0
votes
1 answer

SAX error() handler method called while parsing but no exception thrown -- why?

I want to validate an XML file while it's being parsed. Stand-alone validation with Validator.validate() says it's OK, no exception is thrown while parsing, but the [overridden] error() method from the parsing handler gets called. Why? Is there…
CraftWeaver
  • 707
  • 1
  • 8
  • 21
0
votes
1 answer

Parse the thumbnail url though Defaulthandler in android

Below is the single item from XML : http://www.businessinsider.com/european-markets-open-dec-24-2014-2014-12 10 Things You Need Before European Markets Open
Prateek Yadav
  • 932
  • 6
  • 8
0
votes
1 answer

VLC cross compile in ubuntu 14.04

While preparing third party lib in VLC Cross compile for windows I am getting this error SAX1 support in libxml2 is required. enable it or use expat instead how to enable SAX1 support?? or is there any other solution?
Mohan
  • 1,871
  • 21
  • 34
0
votes
2 answers

How to add node a structured xml at particular location from java

Need help on how to add an xml node at a desired position in the xml. For Example: Original xml
saptarshi
  • 97
  • 1
  • 14
0
votes
1 answer

Android store and retrieve items from xml

I have two questions. I'm working on an Android application that will store a list of items in xml file. This list could potentially grow large, but it depends on the user. I'm using a DOM parser for storing and SAX parser for reading. Right now I'm…
HarveyDX
  • 27
  • 5
0
votes
1 answer

Java Passing Strings to SAX

I'm building a process that creates XML (from a variety of sources and for a variety of purposes that I don't know in advance) and I want to pump the resulting XML directly into standard XML processing like SAX, StAX, and DOM. I've already done a…
Roger F. Gay
  • 1,830
  • 2
  • 20
  • 25
0
votes
1 answer

C++ SAXParser Error with Xerces

An external consultant wrote us a C++ program that reads and parses some XML files. He used an older version of Xerces and I've had to recompile it against a newer version of Xerces and now I'm getting a run-time error. Here is the code snippet that…
kevin
  • 65
  • 10