Appends the CDATA element to the parent element.

@param parent the parent element
@param tagName the CDATA element name
@param value the CDATA element value
@return the CDATA element added to the parent element
547917
public static Element appendCDATAElement(Element parent, String tagName,
            String value) {
        Element child = appendElement(parent, tagName);
        if (value == null) { // avoid "null" word in the XML payload
            value = "";
        }

        Node cdata = child.getOwnerDocument().createCDATASection(value);
        child.appendChild(cdata);
        return child;
    }
728831
public XNElement add(String name) {
        XNElement e = new XNElement(name);
        e.parent = this;
        children.add(e);
        return e;
    }
811318
private String getElementValue(Element parent, String elementName) {
        String value = null;
        NodeList nodes = parent.getElementsByTagName(elementName);
        if (nodes.getLength() > 0) {
            value = nodes.item(0).getChildNodes().item(0).getNodeValue();
        }
        return value;
    }
268758
public boolean addPreserveTag(final String tagName) {

        Vector<Attribute> attributeList = new Vector<Attribute>(1);
        Attribute tagNameAttribute = new Attribute();
        tagNameAttribute.setName(tagName.toLowerCase());
        attributeList.add(tagNameAttribute);
        Tag keepTag = m_nodeFactory.createTagNode(null, 0, 0, attributeList);
        boolean result = m_nodeFactory.addTagPreserve(keepTag);
        return result;
    }
193434
protected function _convertArrayDataToXml(
        $value,
        $addCdata,
        Xml $xml,
        $key,
        $parent,
        array $attributes
    ) {
        $count      = count($value) === 1;
        $isNotEmpty = !empty($attributes);
        $exist      = array_key_exists(0, $value);

        if ($count && $isNotEmpty && $exist) {
            $children = $this->_appendDataToNode(
                $addCdata,
                $xml,
                $key,
                $value[0]
            );
        } else {
            $children = $xml->createElement(
                $this->_integerToStringKey($key)
            );
            $this->_arrayToXml($value, $xml, $addCdata, $children);
        }
        $parent->appendChild($children);

        foreach ($attributes as $attributeKey => $attributeValue) {
            $children->setAttribute($attributeKey, $attributeValue);
        }

        return $parent;
    }
580451
def add_tag_before(tag_name, tag_text, parent_tag, before_tag_name):
    
    new_tag = Element(tag_name)
    new_tag.text = tag_text
    if get_first_element_index(parent_tag, before_tag_name):
        parent_tag.insert( get_first_element_index(parent_tag, before_tag_name) - 1, new_tag)
    return parent_tag
582789
protected function _appendDataToNode($addCdata, Xml $xml, $key, $value)
    {
        if ($addCdata) {
            $cdata      = $xml->createCDATASection($value);
            $element    = $xml->createElement(
                $this->_integerToStringKey($key)
            );
            $element->appendChild($cdata);
        } else {
            $element = $xml->createElement(
                $this->_integerToStringKey($key),
                $value
            );
        }

        return $element;
    }
1092452
public Node appendNode(Object name, Map attributes, Object value) {
        return new Node(this, name, attributes, value);
    }
1149264
function(value) {
      // avoid to override the tag properties already set
      if (contains(keys, key)) return
      // check whether this value is an array
      isArr = isArray(value)
      // if the key was never set
      if (!value)
        // set it once on the tag instance
        parent[key] = dom
      // if it was an array and not yet set
      else if (!isArr || isArr && !contains(value, dom)) {
        // add the dom node into the array
        if (isArr)
          value.push(dom)
        else
          parent[key] = [value, dom]
      }
    }
931320
function appendTag( elem ) {
		var parent;
		// no parent or parent is a root = we're at the top level -> try to add to body
		if ( !elem.parent || elem.parent.type === 'root' ) {
			parent = find( destChildren, 'html' );

			if ( parent ) {
				parent = find( parent.children, 'body' );
			}

			if ( parent ) {
				utils.appendChild( parent, elem );
			} else {
				// append the element to the destination
				utils.append( destChildren[ destChildren.length - 1 ], elem );
			}
			// append the element to the destination
		} else {
			utils.append( destChildren[ destChildren.length - 1 ], elem );
		}
	}
579665
public function setValue( $value, $cdata = FALSE )
	{
		if( !is_string( $value ) && $value !== NULL )
			throw new InvalidArgumentException( 'Value must be a string or NULL' );

		$value	= preg_replace( "/(.*)<!\[CDATA\[(.*)\]\]>(.*)/iU", "\\1\\2\\3", $value );
		if( $cdata || preg_match( '/&|</', $value ) )												//  string is known or detected to be CDATA
		{
			$dom	= dom_import_simplexml( $this );												//  import node in DOM
			$cdata	= $dom->ownerDocument->createCDATASection( $value );							//  create a new CDATA section
			$dom->nodeValue	= "";																	//  clear node content
			$dom->appendChild( $cdata );															//  add CDATA section
		}
		else 																						//  normal node content
		{
			dom_import_simplexml( $this )->nodeValue	= $value;									//  set node content
		}
	}
49031
public void doTag()
            throws JspException, IOException
    {
        String value = getBufferBody(true);
        String text = "";
        if (value.length() > 0)
            text = value;

        Object o = getParent();
        assert (o != null);
        if (!(o instanceof TreeItem)) {
            logger.error("Invalid Parent (expected a TreeItem):" + o.getClass().getName());
            return;
        }

        // assign the value to the parent's label value
        TreeItem ti = (TreeItem) o;
        ti.setItemLabel(text);
    }
1119292
def update_parents_from_tag(tag, definition)
      extra_parents = definitions_for_types(tag.types)

      definition.parents.concat(extra_parents)
    end
131415
public XElement add(String name, Object value) {
        XElement result = add(name);
        result.parent = this;
        result.setValue(value);
        return result;
    }
561857
private String appendXmlEndingTag(String value) {
        StringBuilder sb = new StringBuilder();
        sb.append("</").append(value).append(">");

        return sb.toString();
    }
790986
public static Node getChildNode(Node parentNode, String name, String value){
                List<Node> matchingChildren = getChildren(parentNode, name, value);
                return (matchingChildren.size() > 0) ? matchingChildren.get(0) : null;
        }
279195
public XElement add(String name) {
        XElement result = new XElement(name);
        result.parent = this;
        children.add(result);
        return result;
    }