O4DOIXmlFilter::createOtherTextNode PHP Method

createOtherTextNode() public method

Create a description text node.
public createOtherTextNode ( $doc, $locale, $description ) : DOMElement
$doc DOMDocument
$locale string
$description string
return DOMElement
    function createOtherTextNode($doc, $locale, $description)
    {
        $deployment = $this->getDeployment();
        $otherTextNode = $doc->createElementNS($deployment->getNamespace(), 'OtherText');
        // Text Type
        $otherTextNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'TextTypeCode', O4DOI_TEXT_TYPE_MAIN_DESCRIPTION));
        // Text
        $language = AppLocale::get3LetterIsoFromLocale($locale);
        assert(!empty($language));
        $otherTextNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'Text', htmlspecialchars(PKPString::html2text($description), ENT_COMPAT, 'UTF-8')));
        $node->setAttribute('textformat', O4DOI_TEXTFORMAT_ASCII);
        $node->setAttribute('language', $language);
        return $otherTextNode;
    }