The error
[code]
Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Opening and ending tag mismatch: p line 1 and div in Entity, line: 8 in /var/www/gkt/includes/class_xmltoolbox.php on line 44
Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Opening and ending tag mismatch: root line 1 and p in Entity, line: 10 in /var/www/gkt/includes/class_xmltoolbox.php on line 44
Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Extra content at the end of the document in Entity, line: 10 in /var/www/gkt/includes/class_xmltoolbox.php on line 44
Fatal error: Call to a member function item() on a non-object in /var/www/gkt/includes/class_xmltoolbox.php on line 48
The function
[code=php]
public function inparse($text)
{
// document for parsing text tree
$xml = DOMDocument::loadXML(‘<?xml version=”1.0″ encoding=”utf-8″?><root><p>’ . $text . ‘</p></root>’);
// container for loaded tree
$tree = $this->createDocumentFragment();
foreach( $xml->childNodes->item(0)->childNodes as $child)
{
$tree->appendChild( self::importNode($child) );
}
// returns parsed tree
return $tree;
}
The string passed to the function
[code=html]
Personen: ******* har ansökt om att registera sig på gkt.<br />
Användarnamn: Anto<br />
Email konto: *******@hotmail.com<br />
Telephone: *******<br />
Född:20-09-1991<br />
<br />
Activerings link: <br />
Av activerings link: <a href=”http://www.katten.se”>link</a></div><br />
<br />
Vänliga hälsningar bearhardcreations.
If i remove the link in the string sent to the function it works but i need it to work even if there is html in the string.