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
8
votes
4 answers

SAX parser: Ignoring special characters

I'm using Xerces to parse my XML document. The issue is that XML escaped characters like   appear in characters() method as non-escaped ones. I need to get escaped characters inside characters() method as is. Thanks. UPD: Tried to override…
Alexander Oleynikov
  • 19,190
  • 11
  • 37
  • 51
8
votes
1 answer

How to get element's value from XML using SAX parser in startElement?

Is it possible to get the content of an element from a XML file in startElement function that is the override function of the SAX handler? Below is the specification. 1) XML file
sakura
  • 199
  • 1
  • 2
  • 21
8
votes
2 answers

Android parse Plist file

Hello Im trying to parse an plist file that contains array of dict's. Im trying to do this using xmlwise. The content of the plistfile is here So far I only have this in my activity and im getting the content of the plistfile, but how to parse the…
Darko Petkovski
  • 3,892
  • 13
  • 53
  • 117
8
votes
9 answers

A lightweight XML parser efficient for large files?

I need to parse potentially huge XML files, so I guess this rules out DOM parsers. Is out there any good lightweight SAX parser for C++, comparable with TinyXML on footprint? The structure of XML is very simple, no advanced things like namespaces…
Alex Jenter
  • 4,324
  • 4
  • 36
  • 61
7
votes
5 answers

using SAX parser, how do you parse an xml file which has same name tags but in different elements?

Is it possible to give path expressions in SAX parser? I have an XML file which has a few same name tags, but they are in different element. Is there any way to differentiate between them. Here is the XML:
Srinivas
  • 349
  • 2
  • 4
  • 6
7
votes
3 answers

How to save & update the values in xml file?

I am reading a xml file from the SD card. Here I want to change the values of the XML file and I want to save the file to the sd card.. My code is like below.... Please guide me how to save XML file to the sd card after updating the values.. public…
MUKTHA
  • 165
  • 1
  • 6
7
votes
3 answers

Open XML file from res/xml in Android

I created a Java application which opens an xml file that looks something like this: canine blue And I can open it using: File fXmlFile =…
jeremy
  • 145
  • 1
  • 2
  • 6
7
votes
2 answers

SAXParser equivalent in C#

I have below java code , I need to convert these in C#, Kindly help me .. public class Configuration { private ConfigContentHandler confHandler; public Configuration() { } public boolean parseConfigFile() throws Exception { boolean…
user437890
  • 85
  • 1
  • 1
  • 4
7
votes
3 answers

Why am I getting "MalformedURLException: no protocol" when using SAXParser?

I'm copying code from one part of our application (an applet) to inside the app. I'm parsing XML as a String. It's been awhile since I parsed XML, but from the error that's thrown it looks like it might have to do with not finding the .dtd. The…
user26270
  • 6,904
  • 13
  • 62
  • 94
7
votes
7 answers

Parsing big XML files using SAX parser (skip some lines/tags)

I am currently developing an app that retrieves data from the internet using SAX. I used it before for parsing simple XML files like Google Weather API. However, the websites that I am interested in take parsing to the next level. The page is huge…
Amine
  • 195
  • 2
  • 8
7
votes
3 answers

Difference between SAXParser and XMLReader

What is the difference between below two snippet, if i just have to parse the XML? 1.By using SAXParser parse method: SAXParserFactory sfactory = SAXParserFactory.newInstance(); SAXParser parser = sfactory.newSAXParser(); parser.parse(new…
sakura
  • 2,249
  • 2
  • 26
  • 39
7
votes
3 answers

Handling Empty Tags in XML using Sax Parser, Java

I'm Using a Sax parser to handle a pre-written XML file....i have no way of changing the XML as it is held by another application but need to parse data from it. The XML file contains a Tag < ERROR_TEXT/> which is empty when no error is…
Podge
  • 236
  • 1
  • 4
  • 11
6
votes
1 answer

How can I fetch specific nodes from XML using XPath in Java?

My xml file structure is like this Hi
Krish
  • 63
  • 1
  • 4
6
votes
2 answers

SAX parser get attribute from endelement

I use SAX XML Parser and when I use: public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException I can get attributes. But I need get attributes from public void endElement To parse…
drozdzynski
  • 1,239
  • 2
  • 13
  • 17
6
votes
4 answers

Android: Best parser to parse XML data

I am developing an application in which the first time I am going to parse data from an xml file coming from a remote server. But i am not able to select which parser is efficient or best suited for parsing. As there are mainly three types of…
Manoj Fegde
  • 4,786
  • 15
  • 50
  • 95
1
2
3
62 63