de.hs_rm.cs.lecturenotes.server.core.logical.extractcode
Class XPathProjectionUtil

java.lang.Object
  extended by de.hs_rm.cs.lecturenotes.server.core.logical.extractcode.XPathProjectionUtil

public final class XPathProjectionUtil
extends java.lang.Object

Originates from XPathProjection.
w3c says "XPath is used to navigate through elements and attributes in an XML document. XPath is a major element in W3C's XSLT standard - and XQuery and XPointer are both built on XPath expressions."
This is an Utility class to parse a XML document. This class is mainly used by ExtractCode to parse code tags within a Paragraph

Version:
$LastChangedRevision: 262 $
Author:
Enrico Homann

Field Summary
static java.lang.String XSL_END
          XSL End Template.
static java.lang.String XSL_START
          XSL Start Template.
 
Method Summary
static javax.xml.transform.Transformer createXPathSelector(java.lang.String path)
          Will return the XML Transformer by XPath String path.
static org.w3c.dom.Node xpath(java.lang.String path, java.io.File file)
          Will return the Node by parsing File file using xpath path.
static org.w3c.dom.Node xpath(java.lang.String path, java.io.InputStream inStr)
          Will return the Node by parsing inStr using xpath path.
static org.w3c.dom.Node xpath(java.lang.String path, org.w3c.dom.Node el)
          Will return the Node by parsing Node e1 using xpath path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XSL_START

public static final java.lang.String XSL_START
XSL Start Template.

See Also:
Constant Field Values

XSL_END

public static final java.lang.String XSL_END
XSL End Template.

See Also:
Constant Field Values
Method Detail

xpath

public static org.w3c.dom.Node xpath(java.lang.String path,
                                     java.io.InputStream inStr)
                              throws org.xml.sax.SAXException,
                                     java.io.IOException,
                                     javax.xml.parsers.ParserConfigurationException,
                                     javax.xml.transform.TransformerException
Will return the Node by parsing inStr using xpath path.

Parameters:
path - String
inStr - InputStream
Returns:
Node
Throws:
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerException

xpath

public static org.w3c.dom.Node xpath(java.lang.String path,
                                     java.io.File file)
                              throws org.xml.sax.SAXException,
                                     java.io.IOException,
                                     javax.xml.parsers.ParserConfigurationException,
                                     javax.xml.transform.TransformerException
Will return the Node by parsing File file using xpath path.

Parameters:
path - String
file - File
Returns:
Node
Throws:
javax.xml.transform.TransformerException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException

xpath

public static org.w3c.dom.Node xpath(java.lang.String path,
                                     org.w3c.dom.Node el)
                              throws javax.xml.parsers.ParserConfigurationException,
                                     javax.xml.transform.TransformerException
Will return the Node by parsing Node e1 using xpath path.

Parameters:
path - String
el - Node
Returns:
Node
Throws:
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

createXPathSelector

public static javax.xml.transform.Transformer createXPathSelector(java.lang.String path)
                                                           throws javax.xml.transform.TransformerConfigurationException
Will return the XML Transformer by XPath String path.

Parameters:
path - String
Returns:
Transformer
Throws:
javax.xml.transform.TransformerConfigurationException