Bug Tracker

Ticket #6693 (closed feature: fixed)

Opened 4 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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?

Change History

comment:1 Changed 4 years ago by snover

  • Milestone changed from 1.4.4 to 1.5

Retarget all enhancements/features to next major version.

comment:2 Changed 4 years ago by snover

  • Priority set to undecided
  • Status changed from new to open

comment:3 Changed 4 years ago by dmethvin

#4617 is a duplicate of this ticket.

comment:4 Changed 4 years ago by dmethvin

See #4617 for more discussion.

comment:5 Changed 4 years ago by jaubourg

  • Owner set to jaubourg
  • Status changed from open to assigned

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

Version 0, edited 4 years ago by jaubourg (next)

comment:6 Changed 4 years ago by dmethvin

#7833 is a duplicate of this ticket.

comment:7 Changed 4 years ago by dmethvin

#7854 is a duplicate of this ticket.

comment:8 Changed 4 years ago by jaubourg

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?

comment:9 Changed 4 years ago by snover

  • Priority changed from undecided to high

comment:10 Changed 4 years ago by jaubourg

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

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

comment:11 Changed 4 years ago by jitter

  • Keywords parseXML needsDocs needsTest added

comment:12 Changed 3 years ago by danheberden

  • Keywords needsDocs removed
Note: See TracTickets for help on using tickets.