だから私は、次のXMLスニペットを持っている...XSLT出力テキスト()
私はこれを取ると、HTMLにそれを配置する必要があります。私は各セクション(セクション)にそのセクションのテキストを印刷し、(b)タグが表示されている場合はその単語の周りにそのタグを出力したいと言いたいと思います。しかし、私はセクションのtext()だけを出力することができるので、これを行う方法がわかりません。
しかし、ノードのtext()を出力するだけでなく、そのtext()のタグを操作する必要があります。
これはサンプルXMLです:
<div class="body">
<xsl:for-each select='topic/body/section'>
<div class="section">
<xsl:choose>
<xsl:when test="title">
<h2 class="title sectiontitle"><xsl:value-of select="title"/></h2>
</xsl:when>
<xsl:when test="p">
[I dont know what to put here? I need to output both the text of the paragraph tag but also the html tags inside of it..]
</xsl:when>
</xsl:choose>
</div>
</xsl:for-each>
</div>
所望の出力 - XML内の各セクションのHTMLコードのこのブロック:
<body>
<section>
<title>Response</title>
<p> Some info here <b> with some other tags</b> or lists like <ol> <li>something</li> </ol></p>
</section>
<section>Another section same format, sections are outputted as divs </section>
</body>
これは私がこれまで持っているものです。
<div class="section">
<h2 class="title">Whatever my title is from the xml tag</h2>
<p> The text in the paragraph with the proper html tags like <b> and <u> </p>
</div>
サンプル入力XMLと望ましい出力を提供します。 –
コードをお願いします! – TOUDIdel