Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10219 closed bug (invalid)

jQuery.ParseXML - Unable to retrieve element text

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: core Version: 1.6.3
Keywords: Cc:
Blocked by: Blocking:

Description

Executing the following code does not alert the text contained within the summary element. It seems to be an issue with && occurring in the element.

var xmlDoc = $.parseXML('<?xml version="1.0"?><calculate><result>true</result><summary>true && true = true</summary></calculate>');
$xml = $(xmlDoc);

alert($xml.find('summary').text());

See jsfiddle here: http://jsfiddle.net/yNrX8/

Change History (3)

comment:1 Changed 12 years ago by anonymous

I don't think this is a jquery issue, op just needs to use a cdata wrapper in his xml tag

<summary><![CDATA[true && true = true]]></summary>

comment:2 Changed 12 years ago by Timmy Willison

Component: unfiledcore
Priority: undecidedlow
Resolution: invalid
Status: newclosed

comment:3 Changed 12 years ago by liviuseniuc@…

It is a jQuery bug(I spent some hours until I found the problem) Please change xml.async = "false"; to xml.async = false;

Note: See TracTickets for help on using tickets.