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
1 answer

Need help changing a Ruby Ox Sax XML parser to work with CDATA

I found a nice example (https://gist.github.com/danneu/3977120) on how to parse XML with Ox and Sax. Now I'm trying to make it work with my own XML files that uses CDATA fields. This is the example I found: require "ox" require "open-uri" class…
Reinier
  • 152
  • 1
  • 10
0
votes
1 answer

Is SAX appropriate for this xml parsing in Android?

Provided a similar xml as follows,
awonderer
  • 665
  • 9
  • 26
0
votes
1 answer

Java SAX ContentHandler to create new objects for every root node

I am using SAX to parse some XML. Let's say I have the following XML document: 1 2 1 2
littleK
  • 19,521
  • 30
  • 128
  • 188
0
votes
1 answer

SAX Parser ignoring parent elements? Same named elements grouped as a result

I'm not if this is just how SAX Parser is supposed to work or if I am missing something. This is the sort of XML I am pulling down from my server: Question One
RED_
  • 2,997
  • 4
  • 40
  • 59
0
votes
2 answers

Java Create element in SVG DOM

I create a Java application to modify some SVG files. Here is my issue : I would like to add an elements to the DOM of my SVG files to create link on a rectangle. The SVG file is generated from another application. I need to do it in Java. So here…
0
votes
1 answer

Selecting children from nodes using Nokogiri SAX?

Is there any similar method like (accessions = doc.at_xpath('//Node/Childtag').content) for Nokogiri::XML::SAX::Document? I have XML like: Police-1234 Police-6574
A1aks
  • 187
  • 1
  • 2
  • 15
0
votes
1 answer

SAX Parser Script for DOM Parser in PHP

I need the SAX parser code for my DOM Document code. If anybody would be kind enough to provide me the code for the same. function flipkart_price_fetch($sel_image){ global $sel_image; $price =…
Manoj Majumdar
  • 505
  • 1
  • 4
  • 23
0
votes
1 answer

XAS Parser Android

Not able to find the mistake in below code, it is parsing the xml but the characters function is not getting the bName and bDescription updated, it always shows zero, so I'm not able to set those values in my object. Java Class /** * */ package…
1'hafs
  • 559
  • 7
  • 25
0
votes
1 answer

Conditional XML Parsing using Java

I am looking for a suitable parser to parse through the given XML. I want to parse through the full XML only when tag - 'employee', attribute - 'validated=false' else stop parsing. How we can perform this conditional XML parsing using SAX, STAX or…
SGN
  • 341
  • 1
  • 7
  • 23
0
votes
1 answer

Parsing large XML from Redis with Nokogiri's SAX Parser

I'm trying to parse a large XML file with Nokogiri's SAX parser. It works great when I read the same data from a file, but the memory goes to over 1GB when the data is read from Redis. Here's the most basic code I can use to replicate the issue. Any…
99miles
  • 10,942
  • 18
  • 78
  • 123
0
votes
1 answer

XML is not validated with the XSD using XAS parser

It seems that the validation is not successful in my following xml. addressbook.xml
Samitha
Samitha Chathuranga
  • 1,689
  • 5
  • 30
  • 57
0
votes
1 answer

restart SAX parser from the middle of the document

I'm working on a project that needs to parse a very big XML file (about 10GB). Because process time is really long (about days), It's possible that my code exit in the middle of the process; so I want to save my code's status once in a while and…
mmohaveri
  • 528
  • 7
  • 23
0
votes
2 answers

modifing a xml file using SAX parser

Can we modify or update xml file using SAX parser. If yes, please provide me the sample code or any helpful link my xml file looks like…
user3322698
  • 265
  • 1
  • 5
  • 19
0
votes
1 answer

Generating XML stream in Android

I have to send a large xml document from an android client to a server as a stream. I cannot use DOM parser due to memory constraints. I require something like a SAX parser, but SAX can only parse the data. Is there any library for this? Thanks in…
0
votes
1 answer

Mule: How can project configs cause such misleading SAX errors?

I've fixed the problem below, but since I've hit this more than once and wasted time on it, I'd like to better understand the chain of events that cause the misleading error. Scenario: Mule throws a giant SAX exception parsing your XML, indicating…
Mark Bennett
  • 1,446
  • 2
  • 19
  • 37
1 2 3
99
100