parsing

JSF action, value and binding catalog generator

I am looking for a simple tool that generates a catalog of all used action methods, values and bindings. I'm working on a big JSF/RichFaces project and I have lost the overview of the used links to the beans. Therefore I need a tool (would be nice if it is a Eclipse plugin) that generates a simple list of all used EL expressions. Is the...

Converting string containing localtime into UTC in C

I have a string containing a local date/time and I need to convert it to a time_t value (in UTC) - I've been trying this: char* date = "2009/09/01/00"; struct tm cal = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL}; strptime(date, "%Y/%m/%d/%H", &cal); time_t t = mktime(&cal); but the time_t value I get back is the value that I would expect if ...

How to create class at runtime from file

Is it possible to create a class at runtime from a file without parsing it? If not what would be the best approach to retrieve class properties, constructors and methods from a file? Taking into account that a file could have more than one class just like a typical cs file. ...

jQuery XML Parsing Not Working Locally in Safari 4.0.4

I'm new to this site, but it seems like someone out there should be able to answer my question. I've recently started using jQuery, and spent the day slamming my head against the desk trying to successfully parse an XML file and append the text to a div. After failing at this in Safari, I switched over to Firefox, and found it working p...

Is it possible to stack Yacc grammar rule code?

Lets say I need to run some initialization code everytime I match a rule how can I reduce the redundancy? rule : TOKEN1 { init(); token1Code(); } | TOKEN2 { init(); token2Code(); } ; Also is it possible to do something like rule : TOKEN1 | TOKEN2 { codeForToken1OrToken2(); } ; ...

Find following tag with pyparsing

I'm using pyparsing to parse HTML. I'm grabbing all embed tags, but in some cases there's an a tag directly following that I also want to grab if it's available. example: import pyparsing target = pyparsing.makeHTMLTags("embed")[0] target.setParseAction(pyparsing.withAttribute(src=pyparsing.withAttribute.ANY_VALUE)) target.ignore(pypar...

unit testing file parsing routines?

Hello, I am struggling a bit with how I can unit test parsing a file... Let's say I have a file with 25 columns that could be anywhere from 20-1000 records long... How do I write a unit test against that? The function takes the file as a string as parameter and returns a DataTable with the file contents... The best I can come up with i...

Will ANTLR Help? Different Suggestion?

Before I dive into ANTLR (because it is apparently not for the faint of heart), I just want to make sure I have made the right decision regarding its usage. I want to create a grammar that will parse in a text file with predefined tags so that I can populate values within my application. (The text file is generated by another applicati...

Non-browser emulation of JavaScript - is it possible?

I have a new project I am working on that involves fetching a webpage, (using PHP and cURL) parsing the HTML and javascript out of it and then handling the data in the results. Basically I hit a brick wall when the site uses javascript to fetch its data by AJAX. In this case, the initial data will not appear in the fetched page unless ...

parsing problem

hi every one i need to parse the following one such that it wil store each line in an array avoiding emptyline asthere r two new lines after [2K RTRV-ALM-EQPT::ALL:RA01; [2K SIMULATOR 09-11-20 13:52:15 M RA01 COMPLD "SLOT-1-1-1,CMP:MN,T-FANCURRENT-1-HIGH,NSA,01-10-09,00-00-00,,:\"Fan-T\"," "SLOT-1-1-1,CMP:MJ,T-BATTERYPWR-2-L...

parse query string with urllib in Python 2.4

Using Python2.4.5 (don't ask!) I want to parse a query string and get a dict in return. Do I have to do it "manually" like follows? >>> qs = 'first=1&second=4&third=3' >>> d = dict([x.split("=") for x in qs.split("&")]) >>> d {'second': '4', 'third': '3', 'first': '1'} Didn't find any useful method in urlparse. ...

Parsing every element of an array as an integer

I have a string which I need to split into an array and then perform mathematical functions on each element of the array. Currently I am doing something like this. (Actually, I am doing nothing like this, but this is a very simple example to explain my question! var stringBits = theString.split('/'); var result = parseInt(stringBits[0...

Is there a way to parse html with lxml, but manipulate it with minidom?

I have an application where I've been using html5lib to liberally parse html. I use the minidom interface, because I need a real DOM API and ElementTree is not appropriate for what I'm doing. Here's how I do this: parser = html5lib.XHTMLParser(tree=html5lib.treebuilders.getTreeBuilder('dom')) parser.parse(html) However, parsing huge ...

Parsing this XML feed using PHP

I have an xml feed at this url Now im trying parse the content, particularly the content in <REDIRECT></REDIRECT> tags. I use the following code to try and parse the content but it isnt working and im not sure what im doing wrong. $xml_file = $ADurl; $xml_headline_key = "*XML*RESULTS*LISTING*REDIRECT"; $xml_description_key = "*XML*RES...

How to solve this error "The element type "head" must be terminated > by the matching end-tag "</head>"?

Why i'm getting this error Using org.apache.xerces.parsers.SAXParser Exception net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException: The element type "head" must be terminated by the matching end-tag "". org.xml.sax.SAXParseException: The element type "head" must be terminated by the matching end-tag ""...

What's JavaCC's ADVANTAGE versus ANTLR

Too many people have told me about the disadvantages, but what is its advantage if any? ...

Is there a Java XML API that can parse a document without resolving character entities?

I have program that needs to parse XML that contains character entities. The program itself doesn't need to have them resolved, and the list of them is large and will change, so I want to avoid explicit support for these entities if I can. Here's a simple example: <?xml version="1.0" encoding="UTF-8"?> <xml>Hello there &something;</xm...

Parsing Javascript files with phpDocumentor

I've been playing with phpDocumentor recently and found it quite suitable for my needs. I'm largely working with PHP/HTML/JS/CSS codebases and would like phpDocumentor to parse my Javascript (and perhaps CSS) in order to keep it all together. I've managed to get phpdoc to parse javascript files contained throughout the codebase - howeve...

using the TSqlParser

I'm attempting to parse SQL using the TSql100Parser provided by microsoft. Right now I'm having a little trouble using it the way it seems to be intended to be used. Also, the lack of documentation doesn't help. (example: http://msdn.microsoft.com/en-us/library/microsoft.data.schema.scriptdom.sql.tsql100parser.aspx ) When I run a simple...

in which datatype byte offset of various field of file can be store

i want to store offset of diffn fields of pdf file.. what is good way to do this... ...