Skip to main content

Bug Tracker

Side navigation

#6693 closed feature (fixed)

Opened June 20, 2010 04:52PM UTC

Closed January 09, 2011 05:39AM UTC

Last modified February 01, 2011 03:44PM UTC

Add cross-browser XML parsing support

Reported by: dmethvin Owned by: jaubourg
Priority: high Milestone: 1.5
Component: core Version: 1.4.2
Keywords: xml parse parseXML needsTest Cc:
Blocked by: Blocking:
Description

As documented, the $("<html string>") method only supports parsing HTML strings, but users often try to parse XML strings with it. This doesn't work since jQuery uses the .innerHTML property for parsing and implicitly enforces HTML rules on the string. IE in particular will throw errors or misparse XML strings passed to $() in this way.

It is unlikely that $("<xml string>") can be implemented because it isn't trivial to differentiate an XML string from an HTML one. Perhaps a $.parseXML("<xml string>") method?

Attachments (0)
Change History (12)

Changed October 19, 2010 01:07AM UTC by snover comment:1

milestone: 1.4.41.5

Retarget all enhancements/features to next major version.

Changed October 19, 2010 01:30AM UTC by snover comment:2

priority: → undecided
status: newopen

Changed November 21, 2010 02:11AM UTC by dmethvin comment:3

#4617 is a duplicate of this ticket.

Changed November 21, 2010 02:12AM UTC by dmethvin comment:4

See #4617 for more discussion.

Changed December 22, 2010 08:51PM UTC by jaubourg comment:5

_comment0: The logic already exists in ajax since the rewrite, it's really just a question of testing it further and expose it.1293057428998690
owner: → jaubourg
status: openassigned

The logic already exists in ajax since the rewrite, it's really just a question of testing it further and exposing it.

Changed December 23, 2010 06:58PM UTC by dmethvin comment:6

#7833 is a duplicate of this ticket.

Changed December 28, 2010 03:24PM UTC by dmethvin comment:7

#7854 is a duplicate of this ticket.

Changed December 28, 2010 03:31PM UTC by jaubourg comment:8

parseXML is in the deferred branch. So the branch needs reviewing and merging. On a side note, do we have unit tests for this? Can we compile a list of documents & expressions to build them?

Changed December 30, 2010 02:24AM UTC by snover comment:9

priority: undecidedhigh

Changed January 09, 2011 05:39AM UTC by jaubourg comment:10

resolution: → fixed
status: assignedclosed

The branch has been merged in so this is fixed, except I'd very much appreciate help on building unit tests for this.

Changed January 10, 2011 01:53AM UTC by jitter comment:11

keywords: xml parsexml parse parseXML needsDocs needsTest

Changed February 01, 2011 03:44PM UTC by danheberden comment:12

keywords: xml parse parseXML needsDocs needsTestxml parse parseXML needsTest