parsing

Making Panel Control Visible Causes HTML Parsing Error

Exactly as the title suggests. When I click a button on my webpage it should display a asp .net panel control that was previously hidden. The error I get is Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917) The KB Article points to a few things but most notibly "Th...

How to output formatted html in java

I'm reading an html file like this: try { BufferedReader bufferReader = new BufferedReader(new FileReader(path)); String content; while((content = bufferReader.readLine()) != null) { result += content; } bufferReader.close(); } catch (Exception e) { return e.getMessage(); } And I want to display it in ...

Treetop: parsing single node returns nil

I'm trying to get the basic of Treetop parsing. Here's a very simple bit of grammar so that I can say ArithmeticParser.parse('2+2').value == 4. grammar Arithmetic rule additive first:number '+' second:number { def value first.value + second.value end } end rule number [1-9] [0-9]* { def value...

Using LINQ, need help splitting a byte array on data received from Silverlight sockets

The message packats received contains multiple messages deliniated by a header=0xFD and a footer=0xFE // sample message packet with three // different size messages List<byte> receiveBuffer = new List<byte>(); receiveBuffer.AddRange(new byte[] { 0xFD, 1, 2, 0xFE, 0xFD, 1, 2, 3, 4, 5, 6, 7, 8, 0xFE, 0xFD, 33, 65, 25, 44, 0xFE}...

php xpath problems

I'm doing a cURL POST and get the error response back, parse it into an array but having issues with xpath now. // XML <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <errors xmlns="http://host/project"&gt; <error code="30" description="[] is not a valid email address."/> <error code="12" description="id[] does not exist....

TFHppleElement (Hpple), parsing HTML on iphone

I'm using Hpple and it's been great so far however I want to get all the divs inside another and that I can do. But then I am unable to further parse the contents (innerHTML, and in the source it is labelled innerHTML not innerText) asking for the elements content returns nothing as there is no text directly in that element, only child n...

Parse a CSV file extracting some of the values but not all.

Good day, I have a local csv file with values that change daily called DailyValues.csv I need to extract the value field of category2 and category4. Then combine, sort and remove duplicates (if any) from the extracted values. Then save it to a new local file NewValues.txt. Here is an example of the DailyValues.csv file: category,dat...

Wikipedia : Java library to remove wikipedia text markup removal

Hi, I downloaded wikipedia dump and now want to remove the wikipedia markup in the contents of each page. I tried writing regular expressions but they are too many to handle. I found a python library but I need a java library because, I want to integrate into my code. Thank you. ...

How do I parse boolean logic?

I need to write a boolean logic parser which will translate the boolean logic language to a SQL WHERE clause. The order of the operands will always be in the correct order (with value on the right). Here is a relatively simple example. There could be nested parentheses and the use of NOT operators, etc. (CACOUNT=01 OR CACOUNT=02 OR CA...

Parsing XML data with Namespaces in PHP

I'm trying to work with this XML feed that uses namespaces and i'm not able to get past the colon in the tags. Here's how the XML feed looks like: <r25:events pubdate="2010-05-19T13:58:08-04:00"> <r25:event xl:href="event.xml?event_id=328" id="BRJDMzI4" crc="00000022" status="est"> <r25:event_id>328</r25:event_id> <r25:event_name>Test...

Ruby libraries for parsing .doc files?

Hi all, I was just wondering if anyone knew of any good libraries for parsing .doc files (and similar formats, like .odt) to extract text, yet also keep formatting information where possible for display on a website. Capability of doing similarly for PDFs would be a bonus, but I'm not looking as much for that. This is for a Rails proj...

where the crawled files are stored in Heritrix web crawler

hi i want to know where the crawled files are stored in Heritrix web crawler... thanks and advance ...

Is there a solution to parse wikipedia xml dump file in Java?

I am trying to parse this huge 25GB Plus wikipedia XML file. Any solution that will help would be appreciated. Preferably a solution in Java. ...

GWT CSS Resource to find all classes

What i want to do is: I have css file read from a file into a String. I would like to build some kind of css resource (CssResource ?) out of that string or file, and I'd like to be able to extract from it all classes and id selectors in some kind of collection which i could search. Does anybody know how to do that ? ...

Is this Javascript object literal key restriction strictly due to parsing?

Please refer to the code below, when I "comment in" either of the commented out lines, it causes the error (in IE) of "':' expected". So then is my conclusion correct, that this inability to provide a reference to an object value, as an object key in a string literal; is this strictly an interpreter/parsing issue? Is this a candidate f...

Is there a better way to write this URL Manipulation in Python?

I'm curious if there's a simpler way to remove a particular parameter from a url. What I came up with is the following. This seems a bit verbose. Libraries to use or a more pythonic version appreciated. parsed = urlparse(url) if parsed.query != "": params = dict([s.split("=") for s in parsed.query.split("&")]) if params.get("pag...

Simple C# Tokenizer Using Regex

I'm looking to tokenize really simple strings,but struggling to get the right Regex. The strings might look like this: string1 = "{[Surname]}, some text... {[FirstName]}" string2 = "{Item}foo.{Item2}bar" And I want to extract the tokens in the curly braces (so string1 gets "{[Surname]}","{[FirstName]}" and string2 gets "{Item}" and ...

Convert plain text list to html

I have a plain text list like this: I am the first top-level list item I am his son Me too Second one here His son His daughter I am the son of the one above Me too because of the indentation Another one And I would like to turn that into: <ul> <li>I am the first top-level list-item <ul> <li>I am his so...

Why does dojo parsing time depend on css and images availability?

I have been profiling javascript on my page that uses dojo widgets. I don't use explicit parsing - the parser runs on page load. What I noticed is that if I clear browser cache before refreshing the page, dojo parsing takes much more time than if all the files are already cached. Note that we build all the required dojo modules int...

How to efficently build an interpreter (lexer+parser) in C?

I'm trying to make a meta-language for writing markup code (such as xml and html) wich can be directly embedded into C/C++ code. Here is a simple sample written in this language, I call it WDI (Web Development Interface): /* * Simple wdi/html sample source code */ #include <mySite> string name = "myName"; string toCapital(strin...