parsing

dom4j SAXReader - stop parsing

I am parsing an XML file with SAXReader and would like to stop after a certain amount of time (timeout) in case the file is too large. At a high level, I would like to throw a SAXException in the ContentHandler (in, say, startElement). The idea is described here: http://www.ibm.com/developerworks/xml/library/x-tipsaxstop/ However, dom4...

Parsing XML in iphone Xcode

hi I am new to iphone development. I need to parse simple XML coming from my webserver and store this in database. Is there any sample code for doing the same. Please help me Thanks ...

jQuery XML Parsing/Traversing

Hello guys, I have the following XML- <rows> <row id="5"> <cell>Item1</cell> <attrs> <attr> <id>1</id> <type>CheckBox</type> <values> <value> <id>10</id> </value> <value> <id>11</id> </value> </values> </attr> <attr> <id>2</id> ...

Problem getting date with Universal Feed Parser

It looks like http://portland.beerandblog.com/feed/atom/ is messed up (as are the 0.92 and 2.0 RSS feeds). Universal Feed Parser (latest version from http://code.google.com/p/feedparser/source/browse/trunk/feedparser/feedparser.py?spec=svn295&amp;r=295 ) doesn't see any dates. <title>Beer and Blog Portland</title> <atom:link ...

C# Parse string by parameters Domain="LESSING",Name="Admin"

I have string like \LESSING\root\cimv2:Win32_UserAccount.Domain="LESSING",Name="Admin" How to convert it to LESSING\Admin using Framework? ...

NSDictionary objectForKey return value

I'm using json-framework to create a NSDictionary out of a JSON response. That much works wonderfully. Now, within this JSON payload are one or more objects - let's call them X. Sort of like this in XML: <OBJECTS> <X> ... </x> <X> ... </X> <X> ... </X> </OBJECTS> When I look in the aforementioned NSDictionary ...

How can I make sure all my Python code "compiles"?

My background is C and C++. I like Python a lot, but there's one aspect of it (and other interpreted languages I guess) that is really hard to work with when you're used to compiled languages. When I've written something in Python and come to the point where I can run it, there's still no guarantee that no language-specific errors remai...

Is there a standalone Java library which provides LDAP style parsing?

I'm looking for a standalone Java library which allows me to parse LDAP style filter expressions Is such thing available, or is it advisable to use ANTLR instead and build it by one self? As background: the filter itself is submitted through a network, and I want to create say, the appropriate hibernate Criteria. I'm not doing anything ...

Where can I find a good MediaWiki Markup parser in PHP?

I would try hacking MediaWiki's code a little, but I figured out it would be unnecessary if I can get an independent parser. Can anyone help me with this? Thanks. ...

Parsing a variable-length message

I am implementing the BitTorent protocol using Java via this spec. In the messages section all messages are fixed length except 2 of them; for one of them it's the only variable message after the handshake so I can check others and assume it's a piece message when no other messages met. But for the following message bitfield: <len=0001...

One section, many implementations in C#

I would like to download a file, parse it and put it somewhere. So I have a few sections outlined below and I would like to use the directives below to guide what the program should be doing. I like this form of config and I would like to figure out how to get this to work somehow but I know it won't work exactly like this because I can'...

How do I extract a value from inside of a formatted string?

Hello, I got a string array and values are as follows sNames[0] = "Root | [<root>] | [ID = 1]"; sNames[1] = "Planning | [Root] | [ID = 2]"; From this I would like to just extract ID value .. 1,2.. for now am do this as : foreach (var s in sNames) { int id = Convert.ToInt32(s.Split('|')[2].Split('=')[1].Substring(1,1)); ... } ...

Javascript XML parsing

Hi there, What is the best JavaScript library to parse XML/RSS/Atom feeds? Is there something like Python Feed parser but then for JavaScript ? thanks, Pero ...

Generate Fortran 77 parser from a yacc grammar using Happy (Haskell)

I have stumbled upon the following F77 yacc grammar: http://yaxx.cvs.sourceforge.net/viewvc/yaxx/yaxx/fortran/fortran.y?revision=1.3&amp;view=markup. How can I make a Fortran 77 parser out of this file using Happy? Why is there some C?/C++? code in that .y file? UPDATE: Thank you for your replies! I've been playing with two fresh app...

Simple jQuery ajax example not finding elements in returned HTML

I'm trying to learn jQurey's ajax functions. I've got it working, but jQuery doesn't find elements in the returned HTML DOM. In the same folder as jquery, run this page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xm...

Very basic English grammar parser

I'm writing a very basic parser(mostly just to better understand how they work) that takes a user's input of a select few words, detects whether the sentence structure is OK or Not OK, and outputs the result. The grammar is: Sentence: Noun Verb Article Sentence Sentence Conjunction Sentence Conjunction: "and" "or" "but" Noun: "birds...

What regular expression would match this data?

I have the following within an XHTML document: <script type="text/javascript" id="JSBALLOONS"> function() { this.init = function() { this.wAPI = new widgetAPI('__BALLOONS__'); this.getRssFeed(); }; } </script> I'm trying to select everything in between the two script tags. The id will al...

Is there a framework for defining parsers in JavaScript?

Is there a JavaScript framework that allows to define a parsing grammar using JavaScript syntax, similar to the way Irony does it for C#? ...

Issue With Split In C#

Hi all!! The below are the set of log data found in text file ********************************************************************************** **2008/04/06** 00:35:35 193111 1008 O 9448050132# 74 **2008/04/06** 00:35:35 193116 1009 O ...

ANTLR (field=value), how to express this?

I'm a total lexer and parser newbie, so please have some patience. Eventually I want to be able to express LDAP style Query strings, e.g. '(foo=bar)', '(!foo=bar)', '(&(foo=bar)(!zip=zap))' and have a tree in the end which I could use to create the actual database query (or whatever) So I thought to start with the simplest form, to pars...