parsing

PHP xml parser is cutting urls inside node

Why does parser is cutting url to this: inside node: http://img844.imageshack.us/content.php?page=done&l=img844/4783/php4dd.jpg after parse: [done_page] => l=img844/8828/php4e8.jpg private function _parse($result) { $XMLparser = xml_parser_create('UTF-8'); xml_set_element_handler( $XMLparser, Array($this, 's...

Groovy parsing text file

I have a file log that I would like to parse and am having some issues. At first it seemed it would be simple. I'll go ahead and post the source I have come up with and then explain what I am trying to do. The file I'm trying to parse contains this data: HDD Device 0 : /dev/sda HDD Model ID : ST3160815A HDD Serial No : 5RA020QY HDD Re...

How to parse RSS link (get ulr to RSS) from the page in Python framework Scrapy?

Hello. I want to parse Google search and get links to RSS from each item from the search results. I use Scrapy. I tried this construction, ... def parse_second(self, response): hxs = HtmlXPathSelector(response) qqq = hxs.select('/html/head/link[@type=application/rss+xml]/@href').extract() print qqq item = response.req...

CSS parsing libraries for iPhone

I'm looking for some static library or open source project (in obj-c, released under some permissive license) to parse CSS in iPhone. Any recommendations? ...

Create another dimension to an array housing urls with base url.

Currently I have an array that lists email addresses as the key and urls as the values, I want to use parse_url (unless something better is suggested) and create another dimension to the array with the base url. This is what I currently have: array ( '[email protected]' => array ( 0 => 'http://www.google.co.uk/foo/bar', 1 => '...

parsing multiple values from a file

Hi I have a file that is just one line (one HUGE line) to parse. I want to parse out the value that appears between "Undefined error code" and " id" on this line. The thing is this appears multiple times on the same line with different values everywhere. The following code only gives me the last instance. cat bad_events_P2J3.xml | sed...

Parser in Ruby: dealing with sticky comments and quotes

I am trying to make a recursive-descent parser in Ruby for a grammar, which is defined by the following rules Input consists of white-space separated Cards starting with a Stop-word, where white-space is regex /[ \n\t]+/ Card may consist of Keywords or/and Values also separated by white-space, which have card-specific order/pattern Al...

SimpleDateParser produces incorrect date?

Good morning! I've been working with the following bit of code for the last two hours, scouring forums, Google and the JDK 1.6 docs for any idea what is going on but can't seem to make this work. I would expect the code to output 07/25/2010 11:59:33 PM but what I get instead is 01/25/2010 11:59:33 PM . String dateString = "07/25/2010 ...

How can I parse flashvars from string

How can I parse the flash vars from a string like this? <script type="text/javascript"> flashvars.added = "2010-07-18"; flashvars.name = "testing+purposes"; flashvars.user = "jhon+doe"; </script> I am using curl to get the string. ...

Has anyone parsed Wiktionary?

Wiktionary is a wiki dicitonary that covers many languages. It even has translations. I'd be interested in parsing it and playing with the data, has anyone does anything like this before? Is there any library I can use? (Preferable Python) ...

PHP function for parsing xml into array that doesn't strip nodes with namespaces

I am trying to parse an rss feed that is using the well formed web comment api and having some issues pulling in parts of the XML that contain namespaces. I checked here: http://stackoverflow.com/questions/2483887/php-parsing-xml-file-with-and-without-namespaces but it seems his solution was more for just one specific namespace. Here ...

Is there a tried and true way of accessing specific areas of a very large (>1GB) binary file very fast in .Net

Using a very large raw binary data file, I will be creating a large binary file (greater than 1 GB, usually greater than 4 GB) that contains sensor data from an arbituary number of sensors (1 to 64). The new processed file will be used by user in a GUI where they will be jumping around the file looking at different time periods or other ...

A pointer in the right direction

I have been developing a Mac Desktop app with an iOS device counterpart. Basically I want to upload event information (music gigs etc.) from the Desktop to an online database and be able to read (only) the information whilst mobile. I've got both apps working, using Core Data (with a sqlite database - I was going to use XML but the iOS ...

howto extract simple string from tuple in python (newbie question)

I have a rather large tuple which contains: [('and', 44023), ('cx', 37711), ('is', 36777) .... ] I just want to extract the first string delimited by the single quotes, so the output for the above tuple would be: and cx is How do I code this (with extensibilty built in to some degree)? ...

How to parse xml and loop through it from a string ?

I want parse xml by looping through it. I referred this but I am not able to parse it using the Load function since it expects an URI parameter and not a string and so does LINQ to XML....Can anyone help me out ? ...

Parsing space/tab separated Text file and embedding into XL file

Hi i have my text file in this format **4 1250000209852 01 XXXX XXXX V 3054XXX, XXXX J. 73227DUONG, DUC H. 672XXX COMM HOSP 40352405 RO 07/07/201010/05/2010HO 331.5 XXX NL PRESS XXX ...

Conditional adding HTML column based on another column's attribute

Is there any way I can add a column based on another column's attribute? Something like this: If a td has attribute colspan="2", then add one new  before it. Thank you. <table> <tr> <td>aaa</td> <td colspan="2">bbb</td> <td>ccc</td> <td>ddd</td> <td colspan="2">eee</td> </tr> </table> The result table should ...

How to parse placeholders from text without throwing away your sword so you can fight off the marauders with a lampshade.

I needed to parse placeholders out of text like abc $$FOO$$ cba. I hacked to together something with Scala's parser combinators, but I'm not really happy with the solution. In particular, I resorted to a zero-width matcher in the regular expression (?=(\$\$|\z)) to stop parsing the text and start parsing the placeholders. This sounds pe...

Parsing XML files with regular expressions (Perl)

Hi, I am using regular expression to parse XML file (though regexp is not recommended for xml parsing, but i have to use regexp, no other go). My doubt is how to skip commented lines in XML file, while parsing using Perl. I want Perl to parse XML file, while skipping commented lines. Can anyone help me, please. Thanks Senthil . ...

PARSE XML IN PHP

HI , all .. I need to parse an DWF file using PHP, which looks like an xml file . example : <dwf:Feature id="BXV1D8mWfkGOqXbyoIxQ2g"> <dwf:Properties id="hZBTdWkXKEuhGWAeTpMOUA"> <dwf:Property name="NO" value="0" /> <dwf:Property name="DESCRIPTION" value="Testing" /> <dwf:Property name="DATE" value="06/25/09" /> <dwf:...