opaf-data/src/main/java/inescid/util/XmlUtil.java
/**
     * Converts a dom element to a String
     * 
     * @param node
     * @return the dom as a String
     */
Converts a dom element to a String

@param node
@return the dom as a String
Converts a dom element to a String @param node @return the dom as a String
public static String writeDomToString(Element node) {
        DOMImplementation domImplementation = node.getOwnerDocument().getImplementation();
        if (domImplementation.hasFeature("LS", "3.0") &&
            domImplementation.hasFeature("Core", "2.0")) {
            DOMImplementationLS domImplementationLS = (DOMImplementationLS)domImplementation.getFeature(
                    "LS", "3.0");
            LSSerializer lsSerializer = domImplementationLS.createLSSerializer();
            LSOutput lsOutput = domImplementationLS.createLSOutput();
            lsOutput.setEncoding("UTF-8");
            StringWriter stringWriter = new StringWriter();
            lsOutput.setCharacterStream(stringWriter);
            lsSerializer.write(node, lsOutput);
            return stringWriter.toString();
        } else {
            throw new RuntimeException("DOM 3.0 LS and/or DOM 2.0 Core not supported.");
        }
    }
public static String writeDomToString ( Element node ) { DOMImplementation domImplementation = node . getOwnerDocument ( ) . getImplementation ( ) ; if ( domImplementation . hasFeature ( "LS" , "3.0" ) && domImplementation . hasFeature ( "Core" , "2.0" ) ) { DOMImplementationLS domImplementationLS = ( DOMImplementationLS ) domImplementation . getFeature ( "LS" , "3.0" ) ; LSSerializer lsSerializer = domImplementationLS . createLSSerializer ( ) ; LSOutput lsOutput = domImplementationLS . createLSOutput ( ) ; lsOutput . setEncoding ( "UTF-8" ) ; StringWriter stringWriter = new StringWriter ( ) ; lsOutput . setCharacterStream ( stringWriter ) ; lsSerializer . write ( node , lsOutput ) ; return stringWriter . toString ( ) ; } else { throw new RuntimeException ( "DOM 3.0 LS and/or DOM 2.0 Core not supported." ) ; } }
Converts a dom element to a String
Converts a dom element to a String