Opened 5 years ago

Closed 4 years ago

#7624 closed defect (bug) (fixed)

Export blog feature produces invalid XML file

Reported by: rjwalsh Owned by:
Priority: high Milestone: 2.7
Component: Export Version: 2.6.1
Severity: major Keywords: has-patch commit dev-feedback
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 5 years ago.
Patch to fix undeclared namespace

Download all attachments as: .zip

Change History (9)

  • 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.

Patch to fix undeclared namespace

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   ryan5 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..

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

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

  • Keywords commit added

Why hasn't this been committed?

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