public final class XmlUtil extends Object
Copyright: Copyright (c) 2005
Organization: Sakai Project
| Constructor and Description |
|---|
XmlUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertoLTGT(String value) |
static String |
convertStrforCDATA(String myString)
Deprecated.
use convertToSingleCDATA
|
static String |
convertToSingleCDATA(String text) |
static Document |
createDocument()
Create document object
|
static Document |
createDocument(String xmlString)
Create document object from XML string
|
static Transformer |
createTransformer(Document stylesheet)
Create a transformer from a stylesheet
|
static Transformer |
createTransformer(DOMSource source)
Create a transformer from a stylesheet
|
static DOMSource |
getDocumentSource(javax.servlet.ServletContext context,
String path) |
static String |
getDOMString(Node node)
Get a textual representation of a Node.
|
static String |
processFormattedText(String value) |
static Document |
readDocument(javax.servlet.ServletContext context,
String path)
Read document from ServletContext/context path
|
static Document |
readDocument(String path)
Read document from within spring context path
|
static Document |
readDocument(String path,
boolean trim)
This more forgiving version skips blank lines if trim = true
Otherwise it does a direct parse of the file.
|
static Document |
transformDocument(Document document,
Document stylesheet)
Transform one document into another
|
static Document |
transformDocument(Document document,
Transformer transformer) |
static void |
transformNode(Node source,
Node result,
Transformer transformer) |
public static Document createDocument()
public static Document createDocument(String xmlString)
public static Document readDocument(javax.servlet.ServletContext context, String path)
context - ServletContextpath - pathpublic static Document readDocument(String path)
path - pathpublic static DOMSource getDocumentSource(javax.servlet.ServletContext context, String path)
public static Document readDocument(String path, boolean trim) throws ParserConfigurationException, SAXException, IOException
path - file pathtrim - trim blank lines true/falseParserConfigurationExceptionSAXExceptionIOExceptionpublic static Transformer createTransformer(Document stylesheet)
stylesheet - Documentpublic static Transformer createTransformer(DOMSource source)
source - DOMSourcepublic static Document transformDocument(Document document, Document stylesheet)
document - source Documentstylesheet - XSLT Documentpublic static Document transformDocument(Document document, Transformer transformer)
public static void transformNode(Node source, Node result, Transformer transformer)
public static String getDOMString(Node node)
node - The Node@Deprecated public static String convertStrforCDATA(String myString)
myString - Copyright © 2003–2021 Sakai Project. All rights reserved.