【XML】xmlns, XSLT, RelaxNG, JAXP, etc.【総合】at TECH
【XML】xmlns, XSLT, RelaxNG, JAXP, etc.【総合】 - 暇つぶし2ch676:デフォルトの名無しさん
07/12/01 19:11:18
>>673
やってやれないことはないがあまりオススメしない。
HTMLにするならpreじゃいけないのか?

<xsl:param name="line.delimiter" xml:space="preserve">&#xD;&#xA;</xsl:param>

<xsl:template match="foo:bar">
 <xhtml:div>
  <xsl:call-template name="substitute">
   <xsl:with-param name="str" select="text()" />
  </xsl:call-template>
 </xhtml:div>
</xsl:template>

<xsl:template name="substitute">
<xsl:param name="str" />
 <xsl:choose>
  <xsl:when test="contains($str, $line.delimiter)">
   <xsl:value-of select="substring-before($str, $line.delimiter)" />
   <xsl:text disable-output-escaping="yes">&lt;br /&gt;</xsl:text>
   <xsl:value-of select="$line.delimiter" />
   <xsl:call-template name="substitute">
    <xsl:with-param name="str" select="substring-after($str, $line.delimiter)" />
   </xsl:call-template>
  </xsl:when>
  <xsl:otherwise>
   <xsl:value-of select="$str" />
  </xsl:otherwise>
 </xsl:choose>
</xsl:template>


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch