Hi all,
I added a extention to my local wiki.It works for adding data to the wiki.And I used insertNewArticle() or updateArticle() to add articles.but sometimes it couldn't work .For example $title = 'mywiki'; $content = '{{Infobox_housi...}} This is my wiki'; $wgTitle = Title::newFromText($title); $wgArticle = new Article( $wgTitle ); $wgArticle->insertNewArticle( "$content", '', false, false ); Also actually I get the '$title' and '$content' from a xml file. It shows the error:
Preprocessor_DOM::preprocessToObj generated invalid XML
Backtrace:
#0 D:\wamp\www\mediawiki\includes\parser\Parser.php(2579): Preprocessor_DOM->preprocessToObj('<div style="bor...', 1) #1 D:\wamp\www\mediawiki\includes\parser\Parser.php(3008): Parser->preprocessToDom('<div style="bor...', 1) #2 D:\wamp\www\mediawiki\includes\parser\Parser.php(2880): Parser->getTemplateDom(Object(Title)) #3 D:\wamp\www\mediawiki\includes\parser\Preprocessor_DOM.php(959): Parser->braceSubstitution(Array, Object(PPFrame_DOM)) #4 D:\wamp\www\mediawiki\includes\parser\Parser.php(2632): PPFrame_DOM->expand(Object(PPNode_DOM), 0) #5 D:\wamp\www\mediawiki\includes\parser\Parser.php(875): Parser->replaceVariables('{{Infobox_housi...') #6 D:\wamp\www\mediawiki\includes\parser\Parser.php(327): Parser->internalParse('{{Infobox_housi...') #7 D:\wamp\www\mediawiki\includes\Article.php(2955): Parser->parse('{{Infobox_housi...', Object(Title), Object(ParserOptions), true, true, NULL) #8 D:\wamp\www\mediawiki\includes\Article.php(1665): Article->prepareTextForEdit('{{Infobox_housi...') #9 D:\wamp\www\mediawiki\includes\Article.php(1541): Article->doEdit('{{Infobox_housi...', '', 98) #10 D:\wamp\www\mediawiki\extensions\update\update_body.php(65): Article->myUpdateArticle('{{Infobox_housi...', '', false, false) #11 D:\wamp\www\mediawiki\includes\SpecialPage.php(559): Update->execute(NULL) #12 D:\wamp\www\mediawiki\includes\Wiki.php(229): SpecialPage::executePath(Object(Title)) #13 D:\wamp\www\mediawiki\includes\Wiki.php(59): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest)) #14 D:\wamp\www\mediawiki\index.php(116): MediaWiki->initialize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest)) #15 {main}
why does this happen?how can I solve this problem?
Thanks
vanessa
wikitech-l@lists.wikimedia.org