XMLデータをテキストデータに変換する

説明

XMLデータをテキストデータに変換するにはGXml.value()に変換したいXMLオブジェクトを指定します。変換後はプレーン(標準)テキストになります。
逆引きGoogle Maps APIリファレンス  詳しい解説などは逆引きGoogle Maps APIリファレンス、またはGoogle Maps APIリファレンスを参照してください。

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAasAJryKxWJnBFVJa487d9hTHGAxTVT7IRADYa-JdYz7xQ8IQZBSthgDZdggYpQHsmm6WYtHstQFfLA" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
window.onload = function() {
httpObj = GXmlHttp.create();
httpObj.open("get", "sample.xml");
httpObj.onreadystatechange = function() {
if ((httpObj.readyState == 4) && (httpObj.status == 200)) {
var xmlData = GXml.value(httpObj.responseXML);
document.getElementById("result").innerHTML = xmlData;
}
}
httpObj.send(null);
}
//]]>
</script>
</head>
<body>
<div id="result">読み込み中...</div>
</body>
</html>