In the xsd file, I define a element has more occurrences:
<xs:element name="Type" type="xs:string" maxOccurs="unbounded"/>
so in the xml file the object may contain more “Type” elements.
In the xsl file, What I do is:
<xsl:for-each select="Movies/Movie">
<tr>
<td><xsl:value-of select="Type"/></td>
</tr>
</xsl:for-each>
By this method, I can only get the first “Type” element in that node set. But I want to select all the “Type” elements existed in the “Movies/Movie” node set, is there a way to realize this?
In XSLT 1.0, when xsl:value-of selects more than one node, all but the first are ignored. In XSLT 2.0, you get the space-separated concatenation of all the selected nodes. It sounds from your evidence as if you are using XSLT 1.0. If you want to select multiple elements in XSLT 1.0, you need a for-each: