<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:template match="/"> <nasdaq-order clientid="123"> <!-- Use XPath to select buy transaction for stocks on the NASDAQ --> <xsl:for-each select="/transaction/buy[ticker/@exch='NASDAQ']"> <trans type="buy"> <security><xsl:value-of select="ticker"/></security> <shares><xsl:value-of select="@shares"/></shares> </trans> </xsl:for-each> </nasdaq-order> </xsl:template> </xsl:stylesheet> |