|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.util.XmlUtil
public final class XmlUtil
This class holds utility methods for common xml topics.
| Field Summary | |
|---|---|
static Attributes |
EMPTY_ATTRIBUTES
Immutable and always empty version of a Attributes object. |
| Method Summary | |
|---|---|
static String |
attributeEscape(String attribute)
Encode a string so that it can be safely used as attribute value in XML output. |
static StreamResult |
createStreamResult(File outFile)
Creae a stream result based on a File. |
static String |
escape(String text)
Encode a string so that it can be safely used as text in an element for XML output. |
static String |
formatXml(String org)
Simple xml formatter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Attributes EMPTY_ATTRIBUTES
Attributes object.
| Method Detail |
|---|
public static String attributeEscape(String attribute)
attribute - the attribute value to be encoded.
public static String escape(String text)
text - the element text body.
public static String formatXml(String org)
org - the input to be formated.
public static StreamResult createStreamResult(File outFile)
throws IOException
Error during transformation: javax.xml.transform.TransformerException: java.io.FileNotFoundException: ...%20... at org.apache.xalan.transformer.TransformerImpl.createSerializationHandler(TransformerImpl.java:1218) at org.apache.xalan.transformer.TransformerImpl.createSerializationHandler(TransformerImpl.java:1060) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1268) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1251) ..... The caller must ensure that the created outputstream is closed.
outFile - the file to be used in the stream result.
IOException - in case of an issue while creating the stream.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||