0

より長い XSLT にコメントする必要があり、フラグメントがあります。理解できません:

<xsl:template name="description" match="node/richcontent[@TYPE='NOTE']">                              
    <xsl:element name="description"><xsl:value-of select="richcontent/html"/></xsl:element>      
</xsl:template>

誰でも私を助けることができますか?ありがとうございました!

4

2 に答える 2

2

これは、名前がで値がである属性を持つrichcontentの親で呼び出されたすべての要素に一致し、その要素の値を持つ要素を要素内に挿入します。nodeTYPENOTEdescriptionhtmlrichcontent

つまり、入力は次のようになります。

<node>
    <richcontent type='OTHER'>...</richcontent>
    <richcontent type='NOTE'><richcontent><html>[Some content...]</html></richcontent></richcontent>
</node>

出力は次のようになります。

<description>[Some content...]</description>
于 2013-10-30T16:09:43.837 に答える