Last modified: 2014-05-08 22:27:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 11959 - XML export doesn't begin with an XML prolog
XML export doesn't begin with an XML prolog
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.11.x
All All
: Lowest enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 65031 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-13 04:42 UTC by Nathan Beyer
Modified: 2014-05-08 22:27 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nathan Beyer 2007-11-13 04:42:06 UTC
The Special:Export page generates an XML document without an XML prolog. The HTTP header Content-Type is set as "application/xml;charset=UTF-8", so the encoding is known at request time, but if the result is persisted, a prolog must be added. Duplicating the encoding information in the HTTP headers and content isn't unique to XML; it's a suggested practice for HTML to set the HTTP header and meta element with the content type in the HTML document. Additionally, adding the prolog will make the XML version explicit.

The prolog would just be as follows.

<?xml version="1.0" encoding="UTF-8"?>
Comment 1 Brion Vibber 2007-12-05 20:58:41 UTC
IIRC, a prologue is only required if the encoding is *not* UTF-8. Since the encoding *is* UTF-8, which is XML's default, it is not needed.
Comment 2 Nathan Beyer 2007-12-05 21:11:20 UTC
(In reply to comment #1)
> IIRC, a prologue is only required if the encoding is *not* UTF-8. Since the
> encoding *is* UTF-8, which is XML's default, it is not needed.
> 

XML 1.0 says "SHOULD" - http://www.w3.org/TR/2006/REC-xml-20060816/#sec-prolog-dtd.

XML 1.1 says "MUST" - http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-prolog-dtd.
Comment 3 Brad Jorsch 2014-05-08 15:19:36 UTC
*** Bug 65031 has been marked as a duplicate of this bug. ***
Comment 4 John Mark Vandenberg 2014-05-08 21:57:14 UTC
This bug is causing the API response to also not include the XML prolog.
Comment 5 Brion Vibber 2014-05-08 22:01:54 UTC
The impression that I get is that nobody really uses XML 1.1; our output is XML 1.0.


https://en.wikipedia.org/wiki/XML#Versions :

"The main changes are to enable the use of line-ending characters used on EBCDIC platforms, and the use of scripts and characters absent from Unicode 3.2. XML 1.1 is not very widely implemented and is recommended for use only by those who need its unique features.[36]"



http://www.cafeconleche.org/books/effectivexml/chapters/03.html

"Everything you need to know about XML 1.1 can be summed up in two rules:

    Don't use it.

    (For experts only) If you speak Mongolian, Yi, Cambodian, Amharic, Dhivehi, Burmese or a very few other languages and you want to write your markup (not your text but your markup) in these languages, then you can set the version attribute of the XML declaration to 1.1. Otherwise, refer to rule 1."
Comment 6 John Mark Vandenberg 2014-05-08 22:27:06 UTC
So? be explicit that it isnt being used.  Then you comply with strict XML 1.1 parsers, and the robustness principle.

If the argument is that it could break existing consumers, that would be a valid argument and is something that could be explored.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links