Example usage for org.w3c.dom CDATASection getTextContent

List of usage examples for org.w3c.dom CDATASection getTextContent

Introduction

In this page you can find the example usage for org.w3c.dom CDATASection getTextContent.

Prototype

public String getTextContent() throws DOMException;

Source Link

Document

This attribute returns the text content of this node and its descendants.

Usage

From source file:org.wso2.developerstudio.eclipse.esb.mediators.impl.ScriptMediatorImpl.java

/**
 * {@inheritDoc}//from w w  w.  j a  v  a  2  s.  c  o m
 */
protected void doLoad(Element self) throws Exception {
    // Script language.
    ScriptLanguage language = ScriptLanguage.get(self.getAttribute("language"));
    if (null != language) {
        setScriptLanguage(language);
    }

    // Script type.
    if (self.hasAttribute("key")) {
        setScriptType(ScriptType.REGISTRY_REFERENCE);
        getScriptKey().load(self);

        // Script function.
        if (self.hasAttribute("function")) {
            setMediateFunction(self.getAttribute("function"));
        }
    } else {
        setScriptType(ScriptType.INLINE);
        CDATASection cdata = getChildCDATASection(self);
        if (null != cdata) {
            setScriptBody(cdata.getTextContent());
        }
    }
    super.doLoad(self);
}