Continuous Community Learning
Problem Statement:
Being a part of computer science we often face problems of learning languages and have certain doubts on various concepts. We often refer huge books and attend different forums to get the doubts answered. We aim at having a system which could help one learn languages through Q&A with questions on languages and further bifurcated on topics. This would help the student and other people to get their answers at one place within a very short span of time.
Idea
Novelty of Idea
Relevance and Applications
Solution
Technology Layer/Solution
Technology – Java
Platform – Windows, Google App Engine
Architecture of the Solution – Multi-tenant
Proof of Concept
An application named “Online Book Purchase” was being developed by us before which was a web application and holds certain features which would be helpful for the development of the application
R&D
R&D Elements in the solution
Improvements on existing solution/Provides a new solution
Comment
Comment by Ankit Marothi on May 20, 2011 at 11:13pm Sir, I'm finding some trouble configuring the api's for gdata. Can you help me out in the same.
Comment by Ankit Marothi on May 20, 2011 at 10:49pm
Comment by Ankit Marothi on April 4, 2011 at 9:29pm
Comment by Ankit Marothi on April 3, 2011 at 9:35pm
Comment by Ankit Marothi on April 3, 2011 at 9:26pm
Comment by Ankit Marothi on April 3, 2011 at 9:01pm
Comment by Ankit Marothi on April 3, 2011 at 8:29pm Hi Sir,
I had given a few more tries with the saxparser but since the HTML is not well formed I cant get the data filtered.
Here's a code that i used for balancing the tags it has got to do with HTMLparser but i just am using it to balance the tags.
I cant figure out how to save the changes to the file again. I have commented the lines of codes i added. Can you please help out.
package com.example.tagbalancerwithnekohtml.client;
import java.io.BufferedReader;import java.io.FileReader;import java.io.StringReader;import java.util.ArrayList;import java.util.Arrays;//import java.util.Collection;//import java.util.HashMap;import java.util.List;//import java.util.Map;//import java.io.File.*;import junit.framework.TestCase;
import org.apache.xerces.parsers.AbstractSAXParser;import org.apache.xerces.xni.Augmentations;import org.apache.xerces.xni.QName;import org.apache.xerces.xni.XMLAttributes;import org.apache.xerces.xni.XNIException;import org.apache.xerces.xni.parser.XMLInputSource;import org.cyberneko.html.HTMLConfiguration;import org.cyberneko.html.HTMLTagBalancingListener;
/** * Unit tests for {@link HTMLTagBalancingListener}. * @author * @version $Id: HTMLTagBalancingListenerTest.java 145 2008-03-17 18:18:33Z mguillem $ */public class HTMLTagBalancingListenerTest extends TestCase {
public void testIgnoredTags() throws Exception { String string = "<html><head><title>foo</title></head>" + "<body>" + "<body onload='alert(123)'>" + "<div>" + "<form action='foo'>" + " <input name='text1'/>" + "</div>" + "</form>" + "</body></html>"; // File f111 = new File("C:\\contentofwebsite.xml"); final TestParser parser = new TestParser(); final StringReader sr = new StringReader(string); //String s; // FileReader fr = new FileReader("C:\\contentofwebsite.xml"); // BufferedReader br = new BufferedReader(fr); //StringReader sr1 = new StringReader(s); //while((s=br.readLine())!=null) //{ //StringReader sr1 = new StringReader(s); // final XMLInputSource in = new XMLInputSource(null, "foo", null, sr1, null); final XMLInputSource in = new XMLInputSource(null, "foo", null, sr, null); System.out.println("parsed:"+sr); parser.parse(in); // } final String[] expectedMessages = {"start HTML", "start HEAD", "start TITLE", "end TITLE", "end HEAD", "start BODY", "ignored start BODY", "start DIV", "start FORM", "start INPUT", "end INPUT", "end FORM", "end DIV", "ignored end FORM", "end BODY", "end HTML","start p", "start br","end p", "end br"}; assertEquals(Arrays.asList(expectedMessages).toString(), parser.messages.toString()); }}
class TestParser extends AbstractSAXParser implements HTMLTagBalancingListener{ @SuppressWarnings("unchecked") final List<Object> messages = new ArrayList();// final List<? extends Map<String, Object[]>> currentList = new ArrayList<Map<String, Object[]>>(); //final Collection<HashMap<String, Object[]>> addAll = new ArrayList<HashMap<String, Object[]>>(); // add some hashmaps to the list.. TestParser() throws Exception { super(new HTMLConfiguration()); setFeature("http://cyberneko.org/html/features/balance-tags/ignore-outside-content", true); } public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
messages.add("start " + element.rawname); //currentList.add(element.rawname); super.startElement(element, attributes, augs); } public void ignoredEndElement(QName element, Augmentations augs) { messages.add("ignored end " + element.rawname); //currentList.add(addAll); } public void ignoredStartElement(QName element, XMLAttributes attrs, Augmentations augs) { messages.add("ignored start " + element.rawname); //currentList.add(addAll); }
public void endElement(QName element, Augmentations augs) throws XNIException { messages.add("end " + element.rawname); //currentList.addAll(addAll); super.endElement(element, augs); }}
Comment by Ankit Marothi on March 25, 2011 at 8:30pm
Comment by Ankit Marothi on March 25, 2011 at 7:02pm
Comment by Ankit Marothi on March 25, 2011 at 7:00pm © 2012 Created by Kaushik.
You need to be a member of Peepaal to add comments!
Join Peepaal