アプリ版:「スタンプのみでお礼する」機能のリリースについて

下記のXMLの画像データを表示するためXSL変換したが画像が表示できません
ちなみに同drに設置しています。

 PHOT.XML
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
<photos>
 <photo url="http://www.kahokanko.com/demo/10.jpg"/>
 <photo url="http://www.kahokanko.com/demo/19.jpg"/>
 <photo url="http://www.kahokanko.com/demo/31.jpg"/>
</photos>


STYLE.XSL
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="/">
 <html>
  <head>
   <title>サンプル</title>
   <link rel="styleSheet" type="text/css" href="./xx.css" />
  </head>
  <body>
   <h1>画像を表示</h1>
   <div>
    <xsl:apply-templates />
   </div>
  </body>
  </html>
 </xsl:template>
 <xsl:template match="photo">
  <p class="album">
   <img>
    <xsl:attribute name="src">
     <xsl:value-of select="@url" />
    </xsl:attribute>
   </img>
  </p>
 </xsl:template>
</xsl:stylesheet>

A 回答 (2件)

WindowsXP + safari5.1.7



スタイルシートxx.css

@charset "UTF-8";
html,body{margin:0;padding:0;}
div.album h2{color:green;}
div.album{counter-reset: image;}
div.album p{width:320px;height:auto;position:relative;float:left;margin:10px;}
div.album p img{display:block;width:90%;height:auto;padding:5%;}
div.album p:before {
content: "画像" counter(image) ;
counter-increment: image 1;
}


スタイルシート style.xsl[全角スペース→タブ]

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
  <html>
    <head>
      <title>サンプル</title>
      <link rel="styleSheet" type="text/css" href="./xx.css" />
    </head>
    <body>
      <h1>画像を表示してみよう</h1>
      <div class="album">
        <h2>画像一覧</h2>
        <xsl:apply-templates />
      </div>
    </body>
    </html>
  </xsl:template>
  <xsl:template match="photo">
    <p>
      <img>
        <xsl:attribute name="src">
          <xsl:value-of select="@url" />
        </xsl:attribute>
        <xsl:attribute name="width">320</xsl:attribute>
        <xsl:attribute name="height">240</xsl:attribute>
      </img>
    </p>
  </xsl:template>
</xsl:stylesheet>
「XSL変換したが画像が表示できません」の回答画像2
    • good
    • 0

使用されているブラウザは?


firefox,Opera,safariの最新版、IE8以降で表示できてますが--

この回答への補足

safariの最新版です。

補足日時:2012/11/05 14:31
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!