View RSS Feed

My Java Tips

  1. XSLT processing in Java

    by , 11-28-2011 at 07:25 PM (My Java Tips)
    XSLT (Extensible Stylesheet Language Transformations) is used to transform XML files into other formats like HTML format. There are many XSLT processors (libraries) available to be used in Java for XSLT transformation. These libraries can be used from a Java application like JSP/Servlet to read a XML file and to transform it into a HTML.


    An XSLT processor takes two inputs: an XML file and an XSLT stylesheet.

    For this post, I have chosen Xalan-Java library for the transformation. ...
    Tags: html, xalan-java, xml, xslt Add / Edit Tags
    Categories
    XML
  2. Creating the JNLP File (Java Web Start)

    by , 11-28-2011 at 07:08 PM (My Java Tips)
    If you plan to run an application with Java Web Start, you have to create JNLP (Java Network Launching Protocol) file. In this post, I will briefly explain how to do that.


    The JNLP file is an XML file and it contains elements and attributes that tell Java Web Start how to run the application.

    Presented below is a JNLP file for the Notepad application:

    <!--?xml version="1.0" encoding="utf-8"?-->
    Java Code:
    <jnlp spec="1.0">codebase="URL
    ...
    Tags: jnlp file, xml Add / Edit Tags
    Categories
    Java Web Start
  3. Parsing XML Documents-1 (DOM and SAX)

    by , 11-10-2011 at 05:03 PM (My Java Tips)
    XML files are very useful. Usually they are used to store configuration settings. We can also use XML files to store data so it can be used as a database. A lot of work has been done in this domain and its really very useful working with XML files.



    Now suppose you have a XML file with some useful data.

    college.xml
    XML Code:
    <college>
    <student>
      <first>Shoaib</first>
      <last>Malik</last>
    ...
    Tags: dom parser, sax, xml Add / Edit Tags
    Categories
    Java SE