Example usage for org.w3c.dom Document getNodeValue

List of usage examples for org.w3c.dom Document getNodeValue

Introduction

In this page you can find the example usage for org.w3c.dom Document getNodeValue.

Prototype

public String getNodeValue() throws DOMException;

Source Link

Document

The value of this node, depending on its type; see the table above.

Usage

From source file:gov.hhs.fha.nhinc.lift.proxy.util.ProxyUtil.java

public static org.w3c.dom.Element marshal(Object obj) throws JAXBException {
    try {// w w w  .j  a va2 s  .  com
        Document doc = null;
        JAXBContext jc = JAXBContext.newInstance(obj.getClass());
        Marshaller marshaller = jc.createMarshaller();
        javax.xml.parsers.DocumentBuilderFactory dbf;
        dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        doc = dbf.newDocumentBuilder().newDocument();
        marshaller.marshal(obj, doc);
        log.info("Marshal: " + doc.getNodeValue());
        return doc.getDocumentElement();
    } catch (ParserConfigurationException ex) {
        throw new JAXBException("Unable to create document: " + ex.getMessage());
    }
}