|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.mmapps.commons.util.XmlUtil
public class XmlUtil
Common utilities for handling XML.
Method Summary | |
---|---|
static void |
createAttribute(org.w3c.dom.Element root,
java.lang.String name,
boolean value)
|
static void |
createAttribute(org.w3c.dom.Element root,
java.lang.String name,
double value)
|
static void |
createAttribute(org.w3c.dom.Element root,
java.lang.String name,
float value)
|
static void |
createAttribute(org.w3c.dom.Element root,
java.lang.String name,
int value)
|
static void |
createAttribute(org.w3c.dom.Element root,
java.lang.String name,
long value)
|
static void |
createAttribute(org.w3c.dom.Element element,
java.lang.String name,
java.lang.String value)
|
static org.w3c.dom.Element |
createChild(org.w3c.dom.Element root,
java.lang.String elementName)
|
static org.w3c.dom.Element |
createChild(org.w3c.dom.Element root,
java.lang.String elementName,
java.lang.String namespaceURI)
|
static org.w3c.dom.Element |
createChildText(org.w3c.dom.Element element,
java.lang.String name,
boolean value)
|
static org.w3c.dom.Element |
createChildText(org.w3c.dom.Element element,
java.lang.String name,
double value)
|
static org.w3c.dom.Element |
createChildText(org.w3c.dom.Element element,
java.lang.String name,
float value)
|
static org.w3c.dom.Element |
createChildText(org.w3c.dom.Element element,
java.lang.String name,
int value)
|
static org.w3c.dom.Element |
createChildText(org.w3c.dom.Element element,
java.lang.String name,
long value)
|
static org.w3c.dom.Element |
createChildText(org.w3c.dom.Element element,
java.lang.String name,
java.lang.String value)
|
static org.w3c.dom.Document |
createDocument()
|
static org.w3c.dom.Element |
createElement(org.w3c.dom.Document doc,
java.lang.String elementName)
|
static org.w3c.dom.Element |
createElement(org.w3c.dom.Document doc,
java.lang.String elementName,
java.lang.String namespaceURI)
|
static org.w3c.dom.Element |
createRoot(org.w3c.dom.Document doc,
java.lang.String elementName)
|
static org.w3c.dom.Element |
createRoot(org.w3c.dom.Document doc,
java.lang.String elementName,
java.lang.String namespaceURI)
|
static void |
createText(org.w3c.dom.Element root,
boolean text)
|
static void |
createText(org.w3c.dom.Element root,
double text)
|
static void |
createText(org.w3c.dom.Element root,
float text)
|
static void |
createText(org.w3c.dom.Element root,
int text)
|
static void |
createText(org.w3c.dom.Element root,
long text)
|
static void |
createText(org.w3c.dom.Element root,
java.lang.String text)
|
static java.util.List |
getElements(org.w3c.dom.Element element)
|
static java.lang.String |
getText(org.w3c.dom.Node node)
|
static java.lang.String |
getText(org.w3c.dom.Node node,
java.lang.String defaultvalue)
|
static org.apache.xml.serialize.OutputFormat |
getXmlOutput(boolean indent,
boolean omitComments,
boolean omitDocumentType,
boolean omitXMLDeclaration)
create Output format for xml Be caregull, Textnodes will be fomormatted and indented too. |
static java.lang.String |
serializeDocument(org.w3c.dom.Document doc)
Serialize Document instance to pretty printed
String . |
static java.lang.String |
serializeDocumentFragment(org.w3c.dom.DocumentFragment docfrag)
Serialize DocumentFragment instance to pretty printed
String . |
static java.lang.String |
serializeElement(org.w3c.dom.Element element)
Serialize Document instance to pretty printed
String . |
static java.lang.String |
serializeElement(org.w3c.dom.Element element,
boolean omitxml)
Serialize Document instance to pretty printed
String . |
static org.w3c.dom.Document |
toDocument(java.io.InputStream stream)
Returns a W3C Document representation of the string. |
static org.w3c.dom.Document |
toDocument(java.lang.String str)
Returns a W3C Document representation of the string. |
static java.lang.String |
xmlEscape(java.lang.String fragment)
|
static java.lang.String |
xmlUnescape(java.lang.String escapedFragment)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String serializeDocument(org.w3c.dom.Document doc)
Document
instance to pretty printed
String
.
doc
- Source object.
String
.public static java.lang.String serializeDocumentFragment(org.w3c.dom.DocumentFragment docfrag)
DocumentFragment
instance to pretty printed
String
.
docfrag
- Source object.
String
.public static java.lang.String serializeElement(org.w3c.dom.Element element)
Document
instance to pretty printed
String
.
element
- Source object.
String
.public static java.lang.String serializeElement(org.w3c.dom.Element element, boolean omitxml)
Document
instance to pretty printed
String
.
element
- Source object.omitxml
- Omit the xml declaration from the returned xml
String
.public static org.apache.xml.serialize.OutputFormat getXmlOutput(boolean indent, boolean omitComments, boolean omitDocumentType, boolean omitXMLDeclaration)
indent
- - indent xmlomitComments
- - omit tcommentsomitDocumentType
- - omit document typeomitXMLDeclaration
- - omit xml declaration
public static org.w3c.dom.Document createDocument()
public static org.w3c.dom.Element createChild(org.w3c.dom.Element root, java.lang.String elementName)
public static org.w3c.dom.Element createChild(org.w3c.dom.Element root, java.lang.String elementName, java.lang.String namespaceURI)
public static org.w3c.dom.Element createRoot(org.w3c.dom.Document doc, java.lang.String elementName)
public static org.w3c.dom.Element createRoot(org.w3c.dom.Document doc, java.lang.String elementName, java.lang.String namespaceURI)
public static org.w3c.dom.Element createElement(org.w3c.dom.Document doc, java.lang.String elementName)
public static org.w3c.dom.Element createElement(org.w3c.dom.Document doc, java.lang.String elementName, java.lang.String namespaceURI)
public static void createAttribute(org.w3c.dom.Element element, java.lang.String name, java.lang.String value)
public static void createText(org.w3c.dom.Element root, java.lang.String text)
public static org.w3c.dom.Element createChildText(org.w3c.dom.Element element, java.lang.String name, java.lang.String value)
public static void createAttribute(org.w3c.dom.Element root, java.lang.String name, boolean value)
public static void createAttribute(org.w3c.dom.Element root, java.lang.String name, int value)
public static void createAttribute(org.w3c.dom.Element root, java.lang.String name, float value)
public static void createAttribute(org.w3c.dom.Element root, java.lang.String name, long value)
public static void createAttribute(org.w3c.dom.Element root, java.lang.String name, double value)
public static void createText(org.w3c.dom.Element root, boolean text)
public static void createText(org.w3c.dom.Element root, int text)
public static void createText(org.w3c.dom.Element root, float text)
public static void createText(org.w3c.dom.Element root, long text)
public static void createText(org.w3c.dom.Element root, double text)
public static org.w3c.dom.Element createChildText(org.w3c.dom.Element element, java.lang.String name, boolean value)
public static org.w3c.dom.Element createChildText(org.w3c.dom.Element element, java.lang.String name, int value)
public static org.w3c.dom.Element createChildText(org.w3c.dom.Element element, java.lang.String name, float value)
public static org.w3c.dom.Element createChildText(org.w3c.dom.Element element, java.lang.String name, long value)
public static org.w3c.dom.Element createChildText(org.w3c.dom.Element element, java.lang.String name, double value)
public static java.lang.String getText(org.w3c.dom.Node node)
public static java.lang.String getText(org.w3c.dom.Node node, java.lang.String defaultvalue)
public static org.w3c.dom.Document toDocument(java.lang.String str)
str
- Xml which should be converted
public static org.w3c.dom.Document toDocument(java.io.InputStream stream)
stream
- The input stream with the xml to convert
public static java.util.List getElements(org.w3c.dom.Element element)
public static java.lang.String xmlEscape(java.lang.String fragment)
public static java.lang.String xmlUnescape(java.lang.String escapedFragment)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |