Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#7624 closed defect (bug) (fixed)

Export blog feature produces invalid XML file

Reported by: rjwalsh's profile rjwalsh Owned by:
Milestone: 2.7 Priority: high
Severity: major Version: 2.6.1
Component: Export Keywords: has-patch commit dev-feedback
Focuses: Cc:

Description

The WXR output is not valid XML. Using minidom in Python (which uses Expat) to read the file can produce an error like this:

xml.parsers.expat.ExpatError: unbound prefix: line 90, column 0

Looking at the line in question, we see something like this:

<excerpt:encoded><![CDATA[]]></excerpt:encoded>

The excerpt namespace is not defined. We need to add something like this to the rss attributes near the top of the file:

xmlns:excerpt="http://wordpress.org/excerpt"

or some similar URL.

Attachments (1)

wp.patch (515 bytes) - added by byrnereese 16 years ago.
Patch to fix undeclared namespace

Download all attachments as: .zip

Change History (9)

#1 @reppep
16 years ago

  • Priority changed from normal to high
  • Severity changed from normal to major
  • Version changed from 2.5.1 to 2.6.1

I can confirm that this also triggers errors in Firefox 3 and xml star, and prevents successful importation into Movable Type. I exported from WP 2.6 and 2.6.1.

@byrnereese
16 years ago

Patch to fix undeclared namespace

#2 @byrnereese
16 years ago

I have successfully reproduced this bug on 2.6.2 and WordPress.com on the date the note was made. Attached is a patch to fix this issue.

#3 @ryan
16 years ago

  • Component changed from General to Export
  • Owner anonymous deleted

#4 @DD32
16 years ago

  • Keywords has-patch dev-feedback added

As well as defining the namespace, A file needs to exist at the URL which describes the except namespace. Not something most people understand how to create..

#5 @kylegiga
16 years ago

DD32, only if you're using a validating parser. Quite rare.

The rest of the namespaces don't have files anyways.

#6 @jacobsantos
16 years ago

  • Keywords commit added

#7 @jacobsantos
16 years ago

Why hasn't this been committed?

#8 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9892]) Declare excerpt namespace. Props byrnereese. fixes #7624

Note: See TracTickets for help on using tickets.