Ticket #6693 (closed feature: fixed)
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:5 Changed 2 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 exposing it.
comment:8 Changed 2 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:10 Changed 2 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:12 Changed 2 years ago by danheberden
- Keywords needsDocs removed
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Retarget all enhancements/features to next major version.