[wp-trac] [WordPress Trac] #5460: WXR importer doesn't like XML files with </item><item>

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 2 00:51:56 UTC 2009


#5460: WXR importer doesn't like XML files with </item><item>
--------------------------+-------------------------------------------------
 Reporter:  JeremyVisser  |       Owner:  westi                  
     Type:  defect (bug)  |      Status:  accepted               
 Priority:  low           |   Milestone:  2.9                    
Component:  Import        |     Version:  2.8.4                  
 Severity:  normal        |    Keywords:  has-patch tested commit
--------------------------+-------------------------------------------------
Changes (by benz001):

  * severity:  minor => normal


Comment:

 And just found that it also dies with too many linebreaks eg if you pass
 the XML through a formatter like eclipsetidy

 {{{
         <item>
             <category>
                 <![CDATA[surfaces]]>
             </category>
             <category domain="category" nicename="surfaces">
                 <![CDATA[surfaces]]>
             </category>
             <title>
                 Antique zinc surface (100x170x 2cm) -1
             </title>
             <content:encoded>
                 <![CDATA[<img href='images/100_1439.jpg'
 title='click'><span>Antique zinc surface (100x170x
 2cm)<i>$50</i></span>]]>
             </content:encoded>
         </item>
 }}}
 In this case the item does import, but the post content includes the
 <![CDATA markup and so doesn't show in the post except in HTML view, it
 appears that everything inside the <content:encoded> tag is put into the
 post content, not everything within the CDATA section.

 The following does work

 {{{
         <item>
             <category>
                 <![CDATA[surfaces]]>
             </category>
             <category domain="category" nicename="surfaces">
                 <![CDATA[surfaces]]>
             </category>
             <title>
                 Antique zinc surface (100x170x 2cm) -1
             </title>
             <content:encoded><![CDATA[<img href='images/100_1439.jpg'
 title='click'><span>Antique zinc surface (100x170x
 2cm)<i>$50</i></span>]]></content:encoded>
         </item>
 }}}
 Note that the linebreak within category prior to the category CDATA
 doesn't stop the categories importing properly, its just the post content
 that stuffs up.

 This really does make using the wordpress import for external conversion
 tools/any kind of custom post population quite painful.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/5460#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list