我有其中過濾所需要的「對位」元素如何在xml中過濾段落?
<multitest.document version="1" publication.number="356456"
filterusing="a">
<life quotes>
<para.set>
<para change.bar="no" language="en_ww" filter="a">Your work is going
to fill a large part of your life, and the only way to be truly
satisfied is to do what you believe is great work.
</para>
</para.set>
<para.set>
<para change.bar="no" language="en_ww" filter="b">Your work is going
to fill a large part of your life, and the only way to be truly
satisfied is to do what you believe is great work.
</para>
</para.set>
<para.set>
<para change.bar="no" language="en_ww" filter="c">Your work is going
to fill a large part of your life, and the only way to be truly
satisfied is to do what you believe is great work.
</para>
</para.set>
</life.quotes>
<general quotes>
<para.set>
<para>
Where there is a will there is a way and never give up in life
</para>
</para.set>
</general quotes>
上被施加在這個例子中的XML文檔,作者設置「filterusing」屬性設置爲「是」,所以在這樣的塊當檢查具有filter屬性的段落的規則(para/[@ filter])時,它將該值與過濾器使用值匹配並處理第一段。其他人被忽略,因爲他們不匹配filterusing變量。
如果filterusing,濾除已設置爲「是」,那麼對只應該得到處理和其他段應被忽略,並且沒有過濾器的那些通常應像一般報價
處理如果未應用過濾器,則應該按原樣顯示該段。
<xsl:param name="filter"></xsl:param>
<xsl:template match="//para[@filter]">
<xsl:choose>
<xsl:when test="[email protected]">
<fo:block xsl:use-attribute-sets="filtering_1_atts">
<xsl:value-of select="para[@language=$active_language]"/>
</fo:block>
</xsl:when>
<xsl:when test="@filterusing!='$filter'">
<fo:block xsl:use-attribute-sets="filtering_1_atts">
<xsl:value-of select="."></xsl:value-of>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="filtering_1_atts">
<xsl:value-of select="para[@language=$active_language]"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
即使過濾器使用和過濾器都設置爲「a」,該段仍未顯示。
我對這項技術很陌生,所以請幫助我。
的 的 的 的 –
lakshmi
它沒有工作 – lakshmi
你已經改變了e模板匹配語句,並在那裏引入錯誤。 – Hobbes