私はサイズが約10MBの本当に大きなXMLを持っています..そのxmlには多くのHTMLタグが含まれています..そのため、jqueryでそのxmlを解析すると仮定すると、適切なHTMLフォーマットで出力を取得すると思います..しかし、私は得ています出力としてプレーンテキスト..
XMLからデータをフェッチしている私のjqueryコードは次のとおりです
<script type="text/javascript">
$(document).ready(function () {
$.ajax({
type: "GET",
url: "finaleve.xml",
dataType: "xml",
success: xmlParser
});
});
function xmlParser(xml) {
var markup = [];
$(xml).find("event").each(function () {
markup.push('<section><section><div class="mainevent" >' + $(this).find("name").text() +': '+$(this).find("tagline").text()+'</div><br><div class="description" >' + $(this).find("description").text() +'</div><br></section>');
$(this).find("subevent").each(function () {
markup.push('<section><div class="maineventse">' + $(this).find("namese").text() +': '+$(this).find("taglinese").text()+'</div><br><div class="description1" >' + $(this).find("descse").text() +'</div><br></section>');
});
markup.push('</section>');
});
$(".slides").append(markup.join(""));
}
</script>
純粋なテキストが .text(). によるものであることは知っています..