Bug Tracker

Modify

Ticket #4266 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

title tag ignored in xml

Reported by: surangini Owned by:
Priority: major Milestone: 1.3.2
Component: core Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

If an xml has a title tag, jquery ignores it while navigating through it.

var val = '<values><title>some title value</title><rightscode>G</rightscode><rights>Rights value</rights></values>';

val is an example else its a valid xml.

$.each($(val).children(), function(){

alert('ret: ' + $(this).text() + ' node: ' + this.tagName );

});

Everything get's printed well except title tag. No matter where title tag exists in the xml.

Change History

comment:1 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

$(htmlstring) parses html using the browser's html parser. jQuery cannot determine that the string you gave is xml. If you parse a string with an xml parser you can pass that to $() and jQuery can process it.

 http://docs.jquery.com/Core/jQuery#htmlownerDocument

 http://markmail.org/message/i2kytvrcn7cvdegn

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.