Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Thursday, April 24, 2008

Does Blogger(blogspot) support code formatting?

Here are some attempts..
This is using format my source code for blogger utility.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

</web-app>





Some trial with an excellent web based tool provided at http://www.manoli.net/csharpformat/

I copied the CSS given by this site to my blogger template.
The results are good. But needs tweaking as default blogger linespacing is kind of messed. Then I tweaked it a little bit and mixed with the pre tag in above code formatting style. Works to certain extend. But I am not satisfied with the output. May be I need to change my Blog's basic template to a wider one to accommodate the source code. Thats for later!!!

Saturday, November 3, 2007

Work in progress - my very rich swing application - part 4

Recently, I shifted focus from the "swing" factor. As I was building and polishing the application, I realized that most of my expenses are covered using my bank card. So, if the application just accepts journal entries, it is useful only to students and kids.
So, I started learning about the bank statement formats - yes, OFX - the open financial exchange format. The format is in SGML to my dismay - and there is NO SGML Parser in Java. SGML is a loosely structured but complex language to express data - and XML has replaced it in most fields. 
But anyway, I need to parse OFX. So, I turned to ANTLR - the excellent parser generator. I am in the initial stages of learning curve, but it is really interesting and simple. I think any student who is learning compiler theory should use ANTLR as the learning tool. Oh, coming back to my application - right now, the focus is on parsing only bank statements.

Monday, September 17, 2007

A simple plugin framework in Java

As part of my hobby project, I thought of coming up with some sort of a plug-in mechanism. Though I have worked in a "plug and play"-like J2EE project, I have never done a desktop application with plug-in nature.
I like the way plug-ins work in eclipse. Just extract your plug-ins in to a specific folder. So, my application also would have a similar plug-in mechanism.
Following is the way I have implemented the plug-in manager:

Get to plugins directory
For each file in plugins directory
If file ends with ".jar"
See if there is a plugin-manifest.xml inside the jar
If found read the XML and get data about the Plugin
Save plugin data to a list/map for future use
Add the jar to current classpath as plugin may be used.
End if
End if
End for