我是新來的,所以請原諒我,如果我是無知的。這是我的XML數據的一個樣本。xsl:for-each - 如何格式化列表?
<record ID="ART5843">
<title>This is a sample record</title>
<edition></edition>
<persauthorfull>Lykins, Amy D.</persauthorfull>
<persauthorfull>Cantor, James M.</persauthorfull>
<persauthorfull>Blanchard, Ray</persauthorfull>
<keywords>Generic</keywords>
<keywords>Criminal offences</keywords>
<keywords>Civil offences</keywords>
<keywords>Men</keywords>
<keywords>Psychology</keywords>
<keywords>Research</keywords>
<subjects></subjects>
</record>
我需要<persauthorfull>
到重命名爲<PA>
,然後輸出由分號,例如分離的單線...
<PA>Lykins, Amy D.; Cantor, James M.; Blanchard, Ray</PA>
我使用XSL的for-each以提取名稱,但我不知道如何格式化它們。
<xsl:for-each select="a:persauthorfull">
<PA>
<xsl:attribute name="type">
<xsl:value-of select="."/>
</xsl:attribute>
</PA>
</xsl:for-each>
從我在猜測這是對作者的一個單一的迭代 - 有沒有另一種方式?
請顯示您的完整輸入XML(包括名稱空間定義,例如)和完整的樣式表。你使用什麼版本的XSLT? – 2014-09-27 18:15:31
是的,如果你打算放入XML和XSLT片段,我們將無法爲你提供很多幫助。 – WineSoaked 2014-09-27 18:34:34