Questions tagged [saxparser]

SAX (Simple API for XML) is an event-based parser for XML documents.

SAX is an alternative model to DOM for processing XML documents. Where DOM works on the document as a whole, SAX works piece by piece.

935 questions
2
votes
1 answer

ContentHandler is undefined

I'm trying to learn Python's SAX module from O'Reilly's Python and XML. I'm trying to run the following sample code, but I keep getting an error and I can't figure out why. The first file is handlers.py: class ArticleHandler(ContentHandler): …
Joe Mornin
  • 8,766
  • 18
  • 57
  • 82
2
votes
1 answer

How to skip well-formed for java DOM parser

I know this has been asked multiple times here, but I've a different issue dealing with it. In my case, the app receives a non well-formed dom structure passed as a string. Here's a sample :
Shamik
  • 1,671
  • 11
  • 36
  • 64
2
votes
1 answer

Python parser - defining output filenames

A beginner's question - I have a Python SAX parser that extracts lines of text from a .xml file and writes them to a .txt file. Now I want it to run against all files in the directory and derive the output filename from the input filename, but I…
Belmonte
  • 45
  • 1
  • 6
2
votes
3 answers

DTD Info and Related Errors when Validating (XSD Schema) -- Can They Be Ignored?

So I've got a large amount of XML files. For years they've caused trouble because the people that write them do them by hand, so errors naturally occurred. It's high time we get around to validating them and providing feedback on what's wrong when…
bobber205
  • 12,948
  • 27
  • 74
  • 100
2
votes
2 answers

How to implements two parser to parse one xml?

I have a problem when I parse the xml. The xml format is like this,
Rebecca
  • 85
  • 1
  • 8
2
votes
3 answers

Android: SAX parser progress monitoring

I have a SAX DefaultHandler which parses an InputStream. I don't know how many elements are in the XML so I can't count them on endElement or simmilar. I do know the byte length of the InputStream (read from the http header) but I can't find a…
whlk
  • 15,487
  • 13
  • 66
  • 96
2
votes
1 answer

SAXBuilder to pass an HTTPS URL

Does anyone know how to parse an https URL to the SAXBuilder as an argument. URL url = new URL("https:anyURL"); SAXBuilder parser = new SAXBuilder(); Document doc = null; doc = parser.build(url); This code segment works for an http URL. But when…
MCF
  • 768
  • 2
  • 6
  • 21
2
votes
2 answers

How to parse element with same name at different level in SAX parser java

I have an xml structure like below 2017-02-27T00:00:00+00:00
user7547751
2
votes
4 answers

SAX Parser : Retrieving HTML tags from XML

I have an XML to be parsed, which as given below 12941450184d2315fa63d6358242
Faheem Kalsekar
  • 1,420
  • 3
  • 25
  • 31
2
votes
0 answers

SAX parser in BlackBerry

My XML is in following format Yogesh Chaudhari Yogesh Chaudhari In my BlackBerry…
user469999
  • 2,101
  • 4
  • 24
  • 30
2
votes
1 answer

Read and process only a part of a XML file

I have and XML file with 60k entities. I want to process it in batches of 20k. I am using SAX parser to parse the entities and store it in a list. I parsed 60k entities and stored it in a file/array/list and then process each separately. I dont…
Ramprasad V
  • 347
  • 1
  • 5
  • 16
2
votes
1 answer

Difference in doing Android XML Parsing using DOM Parser and SAX Parser

I would like to know what exact advantage is gained in doing Android XML Parsing using DOM Parser and SAX Parser? Is it like DOm parser is advantageous than SAX Parser or vice-versa? Please clarify. Thanks, Sen
Navaneeth Sen
  • 6,315
  • 11
  • 53
  • 82
2
votes
4 answers

how to remove xml namesapce with SAX parser

I need to do xml transformation with SAX parser, for that i need to remove namespace from the xml. Since we are handling with huge xml, i need to use SAX parser. sample input xml:
pradeep
  • 295
  • 4
  • 17
2
votes
1 answer

How to group elements with similar attribute id of the parent tag in SAX parser [Java]

Sample of the xml: item1 100 -->notice of the duplicate reference id item 2 200 item 3 100 -->notice of the duplicate…
Et Andrea
  • 273
  • 4
  • 21
2
votes
1 answer

SAX parser is not working properly when xml input is given as stream and some xml elements are empty

When xml input is given as input stream to SAX parser with some of the xml elements are empty, then the parser's character method is not called and gets different result. For example, XML input: Hello Sir
pradeep
  • 295
  • 4
  • 17