WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#7624 closed defect (bug) (fixed)

Export blog feature produces invalid XML file

Reported by: 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 6 years ago.
Patch to fix undeclared namespace

Download all attachments as: .zip

Change History (9)

comment:1 reppep6 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.

byrnereese6 years ago

Patch to fix undeclared namespace

comment:2 byrnereese6 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.

comment:3 ryan6 years ago

  • Component changed from General to Export
  • Owner anonymous deleted

comment:4 DD325 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..

comment:5 kylegiga5 years ago

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

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

comment:6 jacobsantos5 years ago

  • Keywords commit added

comment:7 jacobsantos5 years ago

Why hasn't this been committed?

comment:8 ryan5 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.