it.eng.rdlab.soa3.pm.connector.utils
Class XMLUtils

java.lang.Object
  extended by it.eng.rdlab.soa3.pm.connector.utils.XMLUtils

public class XMLUtils
extends Object

Utilities for XML documents

Author:
Ciro Formisano (ENG)

Constructor Summary
XMLUtils()
           
 
Method Summary
static Element createElement(Document rootDocument, String elementName, String textValue, String namespace)
           
static Element createNullElement(Document rootDocument, String elementName, String namespace)
           
static String document2String(Document document)
           
static String element2String(Element element)
          Converts a DOM element into string format
static Document string2Document(String xmlString)
          Converts an xml in string format to a DOM document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtils

public XMLUtils()
Method Detail

document2String

public static String document2String(Document document)
                              throws Exception
Parameters:
document -
Returns:
Throws:
Exception

element2String

public static String element2String(Element element)
                             throws Exception
Converts a DOM element into string format

Parameters:
element -
Returns:
a string representation of the XML
Throws:
Exception

string2Document

public static Document string2Document(String xmlString)
                                throws Exception
Converts an xml in string format to a DOM document

Parameters:
xmlString -
Returns:
Throws:
Exception

createElement

public static Element createElement(Document rootDocument,
                                    String elementName,
                                    String textValue,
                                    String namespace)
Parameters:
rootDocument -
elementName -
textValue -
namespace -
Returns:

createNullElement

public static Element createNullElement(Document rootDocument,
                                        String elementName,
                                        String namespace)
Parameters:
rootDocument -
elementName -
namespace -
Returns:


Copyright © 2012. All Rights Reserved.