parsing

Loading and parsing xml document freezes my GUI in Iphone

Hello, i'm building an app that will read rss feeds and will present them in UITableViews. I searched on google and here and ai decided to use LibXML. When my app starts it checkes if it has a valid internet connection, and grabs an rss feed from which i extract some data and i make an uiTabBar with tableViews. after parsing the first ...

slow construction of tree structure from XML

I'm parsing an XML document into my own structure but building it is very slow for large inputs is there a better way to do it? public static DomTree<String> createTreeInstance(String path) throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstanc...

Language to express complex time multi-intervals?

I'm wondering if anyone knows of any declarative language to express absolute date-time multi-intervals. I mean sets which are the union/intersection/complement of time intervals. Intervals I would like to represent are like: ( (from the second day of the month to the 10th) intersection (months 1,2,3,10) ) union ( (from the second ...

How to convert from parsing with Dom to parsing with SAX

I'm parsing an XML document into my own structure using DOM, but in another question I was advised to use SAX, how would I convert the following: public static DomTree<String> createTreeInstance(String path) throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory docBuilderFactory = DocumentBuilde...

Library for reading HTML files as XML (.NET)

Duplicate: Looking for C# HTML parser. Please close. Can you recommend me a library for reading HTML files as XML in .NET? I'd actually prefer to deal with XML objects rather than text. Ideally, it must fix HTML formatting errors. ...

Read and parse KML in java

Hi Is there any library available to parse KML ? ...

Parsing Meaning from Text

I realize this is a broad topic, but I'm looking for a good primer on parsing meaning from text, ideally in Python. As an example of what I'm looking to do, if a user makes a blog post like: "Manny Ramirez makes his return for the Dodgers today against the Houston Astros", what's a light-weight/ easy way of getting the nouns out of a s...

regex to strip out image urls?

I need to separate out a bunch of image urls from a document in which the images are associated with names like this: bellpepper = "http://images.com/bellpepper.jpg" cabbage = "http://images.com/cabbage.jpg" lettuce = "http://images.com/lettuce.jpg" pumpkin = "http://images.com/pumpkin.jpg" I assume I can detect the start of a link wi...

XML parsing expat in python handling data

I am attempting to parse an XML file using python expat. I have the following line in my XML file: <Action>&lt;fail/&gt;</Action> expat identifies the start and end tags but converts the & lt; to the less than character and the same for the greater than character and thus parses it like this: outcome: START 'Action' DATA '<' DATA 'f...

Import most recent wordpress blog post from rss into django site

Is there a third party django app for eaily importing rss items (specifically wordpress blog posts) in google-code? I've been searching for 20 minutes and can't pull anything up. Ideally the end result would be something like: def news(request): most_recent_post = ??? #get most recent rss post from http://feeds.feedburner.com/codi...

Create Great Parser - Extract Relevant Text From HTML/Blogs

I'm trying to create a generalized HTML parser that works well on Blog Posts. I want to point my parser at the specific entrie's URL and get back clean text of the post itself. My basic approach (from python) has been to use a combination of BeautifulSoup / Urllib2, which is okay, but it assumes you know the proper tags for the blog entr...

SQL parser in C

I want to parse and store the columns and values of a SQL DML (INSERT, UPDATE, DELETE) statement in C. Need the URL of the open source code or a library with which I can link my C program. The platform is SUSE Linux. Have tried to make and use libSQL unsuccessfully. A detailed answer is appreciated. Thanks. Additional Notes: Please sugg...

UIWebView loading parsed html string

Hello, i'm building an app that will display some newsletters to the users. the newsletters are displayed in a uiWebView. I'm reading the url's for the newsletters from an rss feed. I parse the xml, and in a table view i have all the newsletters. When a cell is clicked the uiWebView is pushed and the newsletter is loaded. Because the uiW...

Evaluating mathematical expressions

I am looking for an algorithm that I can use to evaluate mathematical expressions. I've seen a few questions on SO that are simmilar but the answers are C#/Delphi or python specific. I need to write the algorithm in C :) The problem I am trying to solve is given a user input like 3*(2*x + 1)/x I can evaluate the expression for any v...

Python: question about parsing human-readable text

Hi all, I'm parsing human-readable scientific text that is mostly in the field of chemistry. What I'm interested in is breaking the text into a list of words, scientific terms (more on that below), and punctuation marks. So for example, I expect the text "hello, world." to break into 4 tokens: 1) "hello"; 2) comma; 3) "world" and 4) pe...

PHP Xml Attribute Parsing

I am Parasing XML currently using: $data = simplexml_load_string($xmlFile); foreach($data->item as $key => $current){ echo($current); } However I'm wondering, if a hit an element that looks like this: <thumbnail url="http://foo.bar" height="225" width="300"/> How do i pull the inner parts of this? (height, url, width) Thanks! ...

Using XML parser implementation as OSGi service

Hello, I am developing an application using OSGi (Equinox platform), and one of the bundles needs to parse XML files. So far I implemented this with SAX (javax.xml.parsers.SAXParserFactory) and I would like to retrieve the SAXParserFactory from the platform. I saw the OSGi standard provides for a XMLParserActivator to allow JAXP implem...

How to parse a string and create rows in SQL (postgres)

I have a single database field that contains a start date, end date, and exclusions in the form available DD/MONTH/YYYY [to DD/MONTH/YYYY]?[, exclude WORD [, WORD]*]? Meaning it always starts with "available DD/MONTH/YYYY", optionally has a single "to DD/MONTH/YYYY", and optionally has an exclude clause that is a comma separated list ...

How do I parse a variable or multi value cookie in Selenium?

I am trying to parse a multi-value cookie using the Selenium IDE. I have this as my Tracking Cookie Value: G=1&GS=2&UXD=MY8675309=&CC=234&SC=3535&CIC=2724624 So far I have simply captured the full cookie into a Selenium variable with the standard StoreCookieByName command: storeCookieByName Tracking Tracking However I w...

Why is WSDL parser still importing external documents?

I tried to turn off importing documents in WSDL4J (1.6.2) in the way suggested by the API documentation: wsdlReader.setFeature("javax.wsdl.importDocuments", false); In fact, it stops importing XML schema files declared with wsdl:import tag, but does stop importing files declared with xs:import tags. The following code snippet [see ...