com.xmlserv.util
Class XmlUtil
java.lang.Object
|
+--com.xmlserv.util.XmlUtil
- public class XmlUtil
- extends java.lang.Object
Method Summary |
static org.jdom.Element |
addPageAttributes(org.jdom.Element el,
javax.servlet.http.HttpServletRequest req,
java.lang.String version)
Enrich the given Element (normally the root element 'page')
with some path related attributes:
referer: The HTTP Referer
url: The complete URL used to load this page
reluri: The relative URI of this page (without protocol, server, port, path etc.)
|
static org.jdom.Element |
toElement(java.lang.String xmlIn)
Parse a given String, returning a jdom Element starting at tagname. |
static org.jdom.Element |
toElement(java.lang.String xmlIn,
java.lang.String tagname)
Parse a given String, returning a jdom Element starting at tagname. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlUtil
public XmlUtil()
addPageAttributes
public static org.jdom.Element addPageAttributes(org.jdom.Element el,
javax.servlet.http.HttpServletRequest req,
java.lang.String version)
- Enrich the given Element (normally the root element 'page')
with some path related attributes:
- referer: The HTTP Referer
- url: The complete URL used to load this page
- reluri: The relative URI of this page (without protocol, server, port, path etc.)
Inspired by http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html?l=new
toElement
public static org.jdom.Element toElement(java.lang.String xmlIn,
java.lang.String tagname)
throws org.jdom.JDOMException,
XMLServException
- Parse a given String, returning a jdom Element starting at tagname.
- Parameters:
xmlIn
- String to parsetagname
- The tag to cut out of the parsed string. Set to null to return the root element.
toElement
public static org.jdom.Element toElement(java.lang.String xmlIn)
throws org.jdom.JDOMException,
XMLServException
- Parse a given String, returning a jdom Element starting at tagname.
- Parameters:
xmlIn
- String to parse