1. #1
    Sencha User
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    70
    Vote Rating
    0
    robertdbuckley is on a distinguished road

      0  

    Default how to render xml in a panel?

    how to render xml in a panel?


    Hi,

    I am calling xml into a html page using jquery. I am using jquery to ensure than Firefox,chrome and IE all render the content the same.

    I also want to display the html as content in a tabpanel....but the xml is not rendering...only the title.

    can anyone say why this is?


    thanks,

    Rob

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 	<link rel="stylesheet" type="text/css" media="all" href="jquery/style.css" /> 	<script type="text/javascript" src="jquery/jquery-1.6.2.js"></script> 	<title>Reading XML with jQuery</title>      <script>      	$(document).ready(function(){			$.ajax({				type: "GET",				url: "test.xml",				dataType: "xml",				success: function(xml) {					$(xml).find('site').each(function(){						var id = $(this).attr('id');						var title = $(this).find('title').text();						var url = $(this).find('url').text();						$('<div class="items" id="link_'+id+'"></div>').html('<a href="'+url+'">'+title+'</a>').appendTo('#page-wrap');						$(this).find('desc').each(function(){							var brief = $(this).find('brief').text();							var long = $(this).find('long').text();							$('<div class="brief"></div>').html(brief).appendTo('#link_'+id);							$('<div class="long"></div>').html(long).appendTo('#link_'+id);						});					});				}			});		});     </script> </head> <body> 	<div id="page-wrap">      	<h1>Reading XML with jQuery</h1>      </div> </body> </html>
    
    [CODE]
    <?xml version="1.0" encoding="iso-8859-1"?>  <sites>    <site id="0">      <title>Think2Loud</title> 	<url>http://www.think2loud.com</url>      <desc>        <brief>this is the brief description.</brief>        <long>...and this is the long description.  See how long it is :)</long>      </desc>    </site>    <site id="2">      <title>jaredharbour.com</title> 	<url>http://www.jaredharbour.com</url>      <desc>        <brief>this is the brief description.</brief>        <long>...and this is the long description.  See how long it is :)</long>      </desc>    </site>    <site id="3">      <title>Css Tricks</title> 	<url>http://www.css-tricks.com</url>      <desc>        <brief>this is the brief description.</brief>        <long>...and this is the long description.  See how long it is :)</long>      </desc>    </site>  </sites>[/CODE]

  2. #2
    Sencha User
    Join Date
    Oct 2009
    Location
    Cambridge, UK
    Posts
    164
    Vote Rating
    0
    Uberdude is on a distinguished road

      0  

    Default


    Xml is a data format, not a presentation format. You should convert the xml to html if you want to display it visually in a browser. XSLT is a technology designed for this. Some browsers do display xml in a pretty-printed plaintext view without any xslt, if this is what you want then just treat the xml as a big string literal, remembering to escape the angle brackets correctly.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi