de.tisje.java2html
Class XsltTask

java.lang.Object
  extended by de.tisje.java2html.XsltTask

public class XsltTask
extends java.lang.Object

This class is an interface between XSL and Java2Html. Before invoking, a namespace def must be added to the xsl:stylesheet tag:
xmlns:j2h="de.tisje.java2html.XsltTask"
After that, it may be used this way:

    <xsl:value-of select="j2h:setSource(.)"/>
    <xsl:value-of select="j2h:writeFile('temp.xml')"/>
    <xsl:copy-of select="document('temp.xml')"/>
 

Version:
1.0
Author:
Jan Tisje

Constructor Summary
XsltTask()
           
 
Method Summary
static java.lang.String getSource()
          return java source in text form, html codes will be escaped.
static void main(java.lang.String[] args)
          use this class like a common comandline tool.
static void readFile(java.lang.String javaFile)
          read java source from file.
static void setOptions(boolean lineNumbers, boolean pre, boolean xhtml)
          set options from xsl.
static void setSource(java.lang.String javaSource)
          hand over java source read from main xml file.
static void writeFile(java.io.File file)
          output file to a separate xml file
static void writeFile(java.lang.String filename)
          Deprecated. As of Mar 11, 2004 (Markus Gebhard), replaced by writeFile(File)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XsltTask

public XsltTask()
Method Detail

setOptions

public static void setOptions(boolean lineNumbers,
                              boolean pre,
                              boolean xhtml)
set options from xsl.

Parameters:
lineNumbers - if line numbers should be in the output code.
pre - if output code should be formatted using non-breaking spaces and <br>.
xhtml - if output should be viewable stand-alone.

setSource

public static void setSource(java.lang.String javaSource)
hand over java source read from main xml file.


readFile

public static void readFile(java.lang.String javaFile)
                     throws java.io.IOException
read java source from file.

Throws:
java.io.IOException

getSource

public static java.lang.String getSource()
                                  throws java.io.IOException
return java source in text form, html codes will be escaped.

Throws:
java.io.IOException

writeFile

@Deprecated
public static void writeFile(java.lang.String filename)
                      throws java.io.IOException
Deprecated. As of Mar 11, 2004 (Markus Gebhard), replaced by writeFile(File)

output file to a separate xml file, less problems.

Throws:
java.io.IOException

writeFile

public static void writeFile(java.io.File file)
                      throws java.io.IOException
output file to a separate xml file

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
use this class like a common comandline tool. changing of options is not supported, yet



Copyright 2003 - 2006