|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: iterate over data on same line
> I have the following data in my xml: > > <parameter name="measType"> > <in/> > <dataType> > <long> > <range> > <min>24</min> <max>24</max> > <min>26</min> <max>26</max> > <min>28</min> <max>33</max> > <min>44</min> <max>44</max> > <min>900</min> <max>900</max> > </range> > </long> > </dataType> > </parameter> > > > How can I select each pair of min AND max? I need to iterate over both. Is it possible? Apply-templates to all the <min> elements: <xsl:template match="range"> <xsl:apply-templates select="min"/> </xsl:template> Then in the <min> matching template, apply-templates to the first following-sibling <max>: <xsl:template match="min"> <xsl:value-of select="."/> <xsl:apply-templates select="following-sibling::max[1]"/> </xsl:template> <xsl:template match="max"> <xsl:value-of select="."/> </xsl:template> You'll have to replace the value-of's with whatever output you need for the values. cheers andrew
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








