// If the context does not exist, we create a node for it; otherwise we just use it. if ( !$result->length ) { $contextNode = $dom->createElement( 'context' ); $nameNode = $dom->createElement( 'name', htmlspecialchars( $context ) ); $contextNode->appendChild( $nameNode ); $root->appendChild( $contextNode ); } else { $contextNode = $result->item( 0 )->parentNode; } // for every entry, we add a new message foreach ( $data as $info ) { // check if the string is already there $xpath = new DOMXPath( $dom ); $result = $xpath->query( '/message/name[text()="' . htmlspecialchars( $info->original ) . '"]', $contextNode ); if ( $result->length ) { continue; } contentstructuremenu/show_content_structure Node ID: %node_id Visibility: %visibility Knoop ID: %node_id Zichtbaar: %visibility