cz.zcu.fav.kiv.editor.stylesheet
Class XslParser

java.lang.Object
  extended by cz.zcu.fav.kiv.editor.stylesheet.XslParser

public class XslParser
extends java.lang.Object

The XslParser class contains methods for reading and saving XSL stylesheet files.

Version:
1.0, 05/2007
Author:
Marta Vaclavikova

Field Summary
static int INDENT
          The size of indent used in output XSL files
 
Constructor Summary
XslParser()
           
 
Method Summary
static org.w3c.dom.Document createXsltFile()
          Creates a new DOM structure of an empty XSL stylesheet.
static org.w3c.dom.Document readXsltFile(java.lang.String file, ConfigData configData)
          Opens and reads the input XSL file.
static void removeComments(org.w3c.dom.Document document)
          Removes all comments in DOM structure of the XSL stylesheet.
static void removeNode(org.w3c.dom.Node node)
          Remove the input node.
static void removeNodes(java.util.List<org.w3c.dom.Node> nodeList)
          Removes all nodes from the list.
static void saveXsltFile(java.lang.String file, org.w3c.dom.Document document, ConfigData configData)
          Saves changes of actually opened XSL stylesheet file and saves the DOM structure to the XSL file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDENT

public static final int INDENT
The size of indent used in output XSL files

See Also:
Constant Field Values
Constructor Detail

XslParser

public XslParser()
Method Detail

readXsltFile

public static org.w3c.dom.Document readXsltFile(java.lang.String file,
                                                ConfigData configData)
                                         throws OpenFileException
Opens and reads the input XSL file. Creates a DOM structure of the opened XSL document.

Parameters:
file - the name of the XSL file that will be opened.
configData - the data containing editor data structure.
Returns:
DOM structure of the opened XSL document.
Throws:
OpenFileException - if the file cannot be opened.

saveXsltFile

public static void saveXsltFile(java.lang.String file,
                                org.w3c.dom.Document document,
                                ConfigData configData)
                         throws SaveFileException
Saves changes of actually opened XSL stylesheet file and saves the DOM structure to the XSL file.

Parameters:
file - the name of the XSL file that will be saved.
document - the DOM structure of the file that will be saved.
Throws:
SaveFileException - if the file cannot be saved.

createXsltFile

public static org.w3c.dom.Document createXsltFile()
Creates a new DOM structure of an empty XSL stylesheet.

Returns:
a DOM structure of an empty XSL stylesheet.

removeComments

public static void removeComments(org.w3c.dom.Document document)
Removes all comments in DOM structure of the XSL stylesheet.

Parameters:
document - the DOM structure of the XSL stylesheet.

removeNodes

public static void removeNodes(java.util.List<org.w3c.dom.Node> nodeList)
Removes all nodes from the list.

Parameters:
nodeList - the list of nodes that will be removed.

removeNode

public static void removeNode(org.w3c.dom.Node node)
Remove the input node.

Parameters:
node - the node that will be removed.