src/snac/data/BiogHist.php
/**
     * XML-Format this BiogHist
     *
     * Updates this BiogHist to add XML elements, including the <biogHist> tag and any <p> tags necessary.
     */
XML-Format this BiogHist
Updates this BiogHist to add XML elements, including the  tag and any  tags necessary.
XML - Format this BiogHist Updates this BiogHist to add XML elements including the tag and any tags necessary .
public function formatXML() {
        $orig = $this->text;
        if (strpos($orig, "<p") === false) {
            $new = "";
            foreach (preg_split("/((\r?\n)|(\r\n?))/", $orig) as $par) {
                if (!empty(trim($par))) {
                    $new .= "<p>".htmlentities(trim($par), ENT_COMPAT|ENT_XML1)."</p>\n";  
                }
            } 
            $orig = $new;
        }
        $orig = str_replace(["<i>","</i>","<u>","</u>", "<em>", "</em>", " xmlns=\"urn:isbn:1-931666-33-4\""], "", $orig);
        if (strpos($orig, "<biogHist>") === false) {
            $orig = "<biogHist>\n$orig\n</biogHist>";
        }
        $this->text = $orig;
    }
public function formatXML ( ) { $ orig = $ this -> text ; if ( strpos ( $ orig , " <p " ) === false ) { $ new = " " ; foreach ( preg_split ( " /(( \r ? \n )|( \r \n ?))/ " , $ orig ) as $ par ) { if ( ! empty ( trim ( $ par ) ) ) { $ new .= " <p> " . htmlentities ( trim ( $ par ) , ENT_COMPAT | ENT_XML1 ) . " </p> \n " ; } } $ orig = $ new ; } $ orig = str_replace ( [ " <i> " , " </i> " , " <u> " , " </u> " , " <em> " , " </em> " , "  xmlns= \" urn:isbn:1-931666-33-4 \" " ] , " " , $ orig ) ; if ( strpos ( $ orig , " <biogHist> " ) === false ) { $ orig = " <biogHist> \n $ orig \n </biogHist> " ; } $ this -> text = $ orig ; }
XML-Format this BiogHist
 Updates this BiogHist to add XML elements, including the <biogHist> tag and any <p> tags necessary.
XML - Format this BiogHist Updates this BiogHist to add XML elements including the <biogHist > tag and any <p > tags necessary .
// check for <p> tags, and if none, then add them to each line // Remove some HTML tags that are not allowed // check for <biogHist> tag and add if needed