Hello,
Allow me to ask a question about 2 predicates in 1 for-each.
I have this xml-file:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="persons01.xsl"?>
<root>
<organisation>
<communication>
<email>
<emailaddress>e-mail(_at_)bert(_dot_)nl(1)</emailaddress>
</email>
</communication>
<communication2>
<emailaddress2>e-mail(_at_)bert(_dot_)nl(2)</emailaddress2>
</communication2>
</organisation>
<organisation>
<communication>
<email>
<emailaddress>e-mail(_at_)you(_dot_)nl(1)</emailaddress>
</email>
</communication>
<communication2>
<emailaddress2>e-mail(_at_)you(_dot_)nl(2)</emailaddress2>
</communication2>
</organisation>
</root>
I use this stylesheet to collect some information:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<document>
<xsl:for-each select="//communication/email[emailaddress or
//communication2[emailaddress2]]">
<xsl:sort select="."/>
<xsl:value-of select="."/>
<xsl:if test="position() != last()">,
</xsl:if>
</xsl:for-each>
</document>
</xsl:template>
</xsl:stylesheet>
I expected to get the following result:
e-mail(_at_)bert(_dot_)nl(1), e-mail(_at_)bert(_dot_)nl(2),
e-mail(_at_)you(_dot_)nl(1), e-mail(_at_)you(_dot_)nl(2)
But what I get is this:
e-mail(_at_)bert(_dot_)nl(1) , e-mail(_at_)you(_dot_)nl(1)
It is obvious there is something wrong in my for-each-statement, but what?
Any help is this is welcome.
Kind regards,
Bert
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list