Invalid XML Error

acmado

New Member
I have the following code : \[code\]<!DOCTYPE html><html><head><script src="http://code.jquery.com/jquery-latest.js"></script></head><body><p id="someElement"></p><p id="anotherElement"></p><script>var xml = "<count>1</count><ticketID id='2'><incidentUrl>3</incidentUrl></ticketID>",xmlDoc = $.parseXML( xml ),$xml = $( xmlDoc ),$title = $xml.find( "count" );/* append "RSS Title" to #someElement */$( "#someElement" ).append( $title.text() );/* change the title to "XML Title" */$title.text( "XML Title" );/* append "XML Title" to #anotherElement */$( "#anotherElement" ).append( $title.text() );</script></body></html>\[/code\]The above code - produces an error : Invalid XMLHowever , when i change var xml to : var xml = < count >1< / count > it works without any errors.Why is this ?Thanks!
 
Top