我有一份XML文件,显示作者的出版,其中含有某些条款或假日。 与此类似:
<dblp>
<inproceedings key="aaa" mdate="bbb">
<author>author1</author>
<author>author2</author>
<author>author3</author>
<author>author4</author>
<title>Title of pubblications</title>
<pages>12345</pages>
<year>12345</year>
<crossref>sometext</crossref>
<booktitle>sometext</booktitle>
<url>sometext</url>
<ee>sometext</ee>
</inproceedings>
<article key="aaa" mdate="bbb">
<author>author1</author>
<author>author2</author>
<title>Title of pubblications</title>
<pages>12345</pages>
<year>12345</year>
<crossref>sometext</crossref>
<booktitle>sometext</booktitle>
<url>sometext</url>
<ee>sometext</ee>
</article>
</dblp>
I have to create an XSL stylesheet to trasform this file in a .dot file that shows only the collaboration with the authors from all the pubblications. Like this:
author1--author2;
author1--author3;
author1--author4;
author2--author3;
author2--author4;
author3--author4;
这是第一次出版,第二次发行:
author1--author2;
I have to write all the connection by the author with no repeats. How can i do this? I write something to display all the connection but i must delete the repeats. Can i solve using following-sibling?
<xsl:variable name="papers" select="dblp/*"/>
<xsl:for-each select="$papers">
<xsl:variable name="autori" select="author"/>
<xsl:variable name="autori2" select="author"/>
<xsl:for-each select="$autori">
<xsl:variable name="i" select="node()"/>
<xsl:for-each select="$autori2">
<xsl:if test=".!=$i">
<xsl:value-of select="$i"/><xsl:text>--</xsl:text><xsl:value-of select="."/><xsl:text>;</xsl:text>
</xsl:if>
</xsl:for-each><xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:for-each>
Thanks for the answers!