始めまして。勉強中の者です。
以下の結果
http://api.tabelog.com/Ver1/RestaurantSearch/?La …
を見やすくHTMLで表示されるにはどのような仕組みにすれば良いのでしょうか?
PHP5の環境です。どのようにすれば、通常のウェブページのように表示されるのでしょうか?
いまいち仕組みが分かりません。ご教授願います。
A 回答 (2件)
- 最新から表示
- 回答順に表示
No.1
- 回答日時:
回答じゃなくてすまん。
PHP5指定なのでPHPカテで出した方が回答付きやすいかもしれない
#俺はPHPは書けないので今まで回答せず静観していた。XSLTは書いてたんだけどねぇ・・・(以下)
#なお、できることなら新たな質問を立ち上げるときには【この回答にはポイントを付けずに】締め切って欲しい
===========
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="xml" version="1.0" encoding="UTF-8" standalone="yes" omit-xml-declaration="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
indent="yes"
media-type="text/html" />
<xsl:template match="/">
<html>
<head>
<title>食べログAPIサンプル</title>
<style>
table{
margin:0 auto;
border-style:solid;
}
tbody{
margin:0 auto;
}
th,td {
border-style:solid;
text-align:center;
}
</style>
</head>
<body>
<xsl:apply-templates select="RestaurantInfo" />
</body>
</html>
</xsl:template>
<xsl:template match="Item">
<table>
<xsl:attribute name="id">RestaurantInfo<xsl:value-of select="position()" /></xsl:attribute>
<caption><xsl:value-of select="RestaurantName" /></caption>
<colgroup>
<col class="TabelogUrl" />
</colgroup>
<colgroup>
<col class="TotalScore" />
</colgroup>
<colgroup>
<col class="TasteScore" />
</colgroup>
<colgroup>
<col class="ServiceScore" />
</colgroup>
<colgroup>
<col class="MoodScore" />
</colgroup>
<colgroup>
<col class="Situation" />
</colgroup>
<colgroup>
<col class="DinnerPrice" />
</colgroup>
<colgroup>
<col class="LunchPrice" />
</colgroup>
<colgroup>
<col class="Address" />
</colgroup>
<colgroup>
<col class="Tel" />
</colgroup>
<colgroup>
<col class="BusinessHours" />
</colgroup>
<colgroup>
<col class="Holiday" />
</colgroup>
<tbody>
<tr><th>食べログURL</th><td><a><xsl:attribute name="href"><xsl:value-of select="TabelogUrl" /></xsl:attribute><xsl:value-of select="TabelogUrl" /></a></td></tr>
<tr><th>総合評価</th><td><xsl:value-of select="TotalScore" /></td></tr>
<tr><th>料理・味</th><td><xsl:value-of select="TasteScore" /></td></tr>
<tr><th>サービス</th><td><xsl:value-of select="ServiceScore" /></td></tr>
<tr><th>雰囲気</th><td><xsl:value-of select="MoodScore" /></td></tr>
<tr><th>おすすめシチュエーション</th><td><xsl:value-of select="Situation" /></td></tr>
<tr><th>ディナーの値段</th><td><xsl:value-of select="DinnerPrice" /></td></tr>
<tr><th>最寄り駅</th><td><xsl:value-of select="LunchPrice" /></td></tr>
<tr><th>住所</th><td><xsl:value-of select="Address" /></td></tr>
<tr><th>連絡先電話番号</th><td><xsl:value-of select="Tel" /></td></tr>
<tr><th>営業時間</th><td><xsl:value-of select="BusinessHours" /></td></tr>
<tr><th>定休日</th><td><xsl:value-of select="Holiday" /></td></tr>
<!--多分LongtitudeとLatitudeはGoogle Mapsに渡すパラメータだが,コーディング経験ないので省略-->
</tbody>
</table>
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・人生のプチ美学を教えてください!!
- ・10秒目をつむったら…
- ・あなたの習慣について教えてください!!
- ・牛、豚、鶏、どれか一つ食べられなくなるとしたら?
- ・【大喜利】【投稿~9/18】 おとぎ話『桃太郎』の知られざるエピソード
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
スタイルシートを使用したXM...
-
CPUの考え方を教えてください ...
-
XMLで要素が記述された順番に意...
-
4バイトを10進数に変換する方法
-
昔Winnyってありましたけど、あ...
-
東芝のDynabookなのですがアン...
-
同じタグ名の項目取得
-
SNMP リンクダウンとノードダ...
-
VBでXMLを扱えるコントロールは...
-
ルート要素ノードが2個ある場合?
-
xmlファイルが上手にHTMLに変換...
-
C#で使用中のファイルに別のフ...
-
TreeViewに重複する値をセット
-
XMLファイルの作り方がわかりま...
-
XMLウインドウ表示時のエラー
-
VBSでxmlの値を書き換えたい
-
VB.NETで最後フォのフォ...
-
Visual Basic .NET の識別子は...
-
ASPで型宣言
-
PHPでのXMLの編集・削除の方法
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
xmlのテキストにリンクを張りた...
-
XSLTで固定長データファイルを...
-
タグの有無の判定
-
XSLで、XMLの空タグを制御したい。
-
XMLのHTMLへの変換 (初心者)
-
xmlの複数条件で検索
-
XSLでXMLデータをタブ区切りデ...
-
スタイルシートを使用したXM...
-
XSL内でJavaScriptを記述し、Ja...
-
XSL中の改行、タブを無効にした...
-
XSLTにてタグ名を取得する方法
-
XML/XSLについて質問です
-
重複するものを消したい
-
xmlの属性が重複しているのをx...
-
XMLの名前空間をXSLから指定す...
-
XSLで特定のタグだけを出力する...
-
XSLTを使用したXML->XML変換で...
-
うまく表示されない
-
XMLから指定テキストのみを抜き...
-
XMLをXSLTやCSSに変換してHTML...
おすすめ情報