se.kb.xml
Class XMLUtils

java.lang.Object
  extended by se.kb.xml.XMLUtils

public class XMLUtils
extends Object

Utility class that has some static helper methods for handling XML.

Author:
Oskar Grenholm, National Library of Sweden

Field Summary
static String ENCODING
           
 
Method Summary
static void writeXmlTo(Element element, OutputStream stream)
          Writes the XML contained in the Element to the specified OutputStream.
static String xmlToString(Element xml)
          Converts an Element to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final String ENCODING
See Also:
Constant Field Values
Method Detail

writeXmlTo

public static void writeXmlTo(Element element,
                              OutputStream stream)
                       throws IOException
Writes the XML contained in the Element to the specified OutputStream.

Parameters:
element - the XML element to write
stream - the stream to write to
Throws:
IOException

xmlToString

public static String xmlToString(Element xml)
                          throws IOException
Converts an Element to a String.

Parameters:
xml - the XML element to write
Returns:
a String with the XML
Throws:
IOException


Copyright © 2008. All Rights Reserved.