XSL/XSLT (558レス)
上下前次1-新
509: 2007/04/05(木)19:40 ID:??? AAS
力いっぱい亀レスしてみる。
>>484
<xsl:template match="foo">
<xsl:text>var msg = "</xsl:text>
<xsl:call-template name="escape">
<xsl:with-param name="str" select="."/>
</xsl:call-template>
<xsl:text>";</xsl:text>
</xsl:template>
<xsl:template name="escape">
<xsl:param name="str"/>
<xsl:if test="string-length($str) != 0">
<xsl:variable name="char" select="substring($str,1,1)"/>
<xsl:choose>
<xsl:when test="$char = '\'">\\</xsl:when>
<xsl:when test="$char = '"'">\"</xsl:when>
<xsl:when test="$char = ' '">\n</xsl:when>
<xsl:when test="$char = '	'">\t</xsl:when>
<xsl:otherwise><xsl:value-of select="$char"/></xsl:otherwise>
</xsl:choose>
<xsl:call-template name="escape">
<xsl:with-param name="str" select="substring($str,2)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
上下前次1-新書関写板覧索設栞歴
あと 49 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.006s