parsing

What is called defer-node-expansion in XML?

Hello All, What this feature "http://apache.org/xml/features/dom/defer-node-expansion" does? i have read about this feature. But was really unable to understand what will happen if this is set to false. Can anyone come up elaborately on this as i don't find any other link that explain to the ability i understand. ...

Add TM to text with jQuery?

I need a way to go through all the text on my page, including links and other controls and find words that are in a certain list and add the html character entity ™ () to them. I need this to be fast too. The list is held in a javascript array. I've already got code using .each to find all Links on the page with text from that lis...

SSIS: Strip Characters from Flat File

What's the best way to strip out characters from flat files in SSIS? In my case, I need to remove all quotes from the file before processing. EDIT: How can I run an executable against some files from SSIS? Can I somehow use the source connection as an input or would I have to pass in the file names as parameters? ...

Batch File/Script to delete Several non sequential lines from text file(s)

I have read the suggestion listed here. http://stackoverflow.com/questions/418916/delete-certain-lines-in-a-txt-file-via-a-batch-file The batch file solution seems to work untill i get to about 5 ignore conditiobal strings and then the output starts to ignore very large sections of the text files(s) even things it shouldn't. Basically...

Any good javascript BBCode parser?

Currently i'm parsing bbcode server side but i'd like to show a preview just like this site does. If I process the bbcode serverside using ajax it's a bit laggy, so i thought doing it client side, to just show the preview. Do you guys know any bbcode parser written in javascript? ...

C++ create a parser

What's the best way to create a parser in C++ from a file with grammar? ...

Best Way to parse an iCalendar string in php

I am trying to write a class that can parse an iCalendar file and am hitting some brick walls. Each line can be in the format: PARAMETER[;PARAM_PROPERTY..]:VALUE[,VALUE2..] It's pretty easy to parse with either a bunch of splits or regex's until you find out that values can have backticked commas, also they can be double quote marked ...

Parsing search query

Hello, I need to parse a search query with a "Google-like" syntax (but simpler, since I don't need parenthesis, operator nesting and such). An example string might be: TAG1: a,b,c TAG2: 123 TAG3: a,45,44,b So, simply put, I need to recognize tokens which look like a TAG (i.e "color", "name", "age") followed by : and by a single "word"...

australian mobile numbers strings formatting

i need to format mobile numbers. e.g. +61421 123 123 0421 123 123 0061421123123 0421 123123 1) into this type of string to save in the dbf 0421123123 2) then display it in this format 0421 123 123 any suggestion on the most effective way to format the numbers? ...

Library to parse SQL statements.

I would like to be able to parse an arbitrary SQL SELECT statement and retrieve the various component parts (columns, relations, JOIN conditions, WHERE conditions, ORDER BY columns), ideally using Delphi. A quick google search shows several different freeware products, but it's not clear if they are complete and/or under active developm...

Advanced PDF Parsing Using Python (extracting text without tables, etc.): What's the Best Library?

I'm looking for a PDF library which will allow me to extract the text from a PDF document. I've looked at PyPDF, and this can extract the text from a PDF document very nicely. The problem with this is that if there are tables in the document, the text in the tables is extracted in-line with the rest of the document text. This can be prob...

Parsing string interpolation in ANTLR

I'm working on a simple string manipulation DSL for internal purposes, and I would like the language to support string interpolation as it is used in Ruby. For example: name = "Bob" msg = "Hello ${name}!" print(msg) # prints "Hello Bob!" I'm attempting to implement my parser in ANTLRv3, but I'm pretty inexperienced with using ANTLR...

Parsing a RFC 822 date with NSDateFormatter

I'm using a NSDateFormatter to parse a RFC 822 date on the iPhone. However, there is no way to specify optional elements in the date format. There are a couple of optional parts in the RFC 822 specification which is breaking the date parser. If nothing works out, I'd probably have to write a custom parser to obey the specs. For example,...

compairing some pattern with regular expression C#

i am parsing binary file. File size can be large. i want to search a some pattern in that file. the string is anynumber 0 obj<< any alpha,symbol,digit...anything >>endobj Bold text indicates compulsory string. So, My QUESTION is - should i do it by regular expression or search it by coding. After that i want to store it in a...

How do I parse this JSON?

I'm using a book API that returns the following var _OLBookInfo = { "ISBN:234234234234234": { "bib_key": "ISBN:234234234234234", "preview": "noview", "preview_url": "http://openlibrary.org/b/adsfasdfa", "info_url": "http://openlibrary.org/b/adsfasdf", "details": { "publishers":...

How to pass a struct to a function in a yacc file?

I have this in my yacc file. var_declaration : type_specifier ID ';' {$2->args = ""; $2->value = 0; $2->arraysize = 0; $2->type = "variable";} Everything above works. I want to add this to it. fn($2); From inside the function, I want to do stuff like this. fn(struct symtab sp) { sp->value = 0; } But when I try to c...

Lua equivalent to shlex?

Is there a Lua equivalent for python's shlex library? ...

XMLLite parser hangs

I'm parsing an XML using XMLLite. I notice that when its a relatively large file, the reader's pointers fails to locate the next element(tag) of the file. When i reduced the contents of the file, it could successfully parse. The reader continually shows node type "XmlNodeType_None" and fails to complete parsing, getting stuck in an infi...

yylval and union

What is the purpose of union in the yacc file? Is it directly related to yylval in the flex file? If you don't use yylval, then you don't need to use union? ...

parsing CSS with Java

I need to parse CSS files in Java, and have tried using the Batik and CSSParser libs with success. The issue I am having is that when I run into IE hacks, I loose the formatting; it appears to me that the DOM used by org.w3c.css.sac won't accommodate the IE Hacks. e.g.- /* The '\' isn't retained */ someselector { padding:...