Skip to content

Instantly share code, notes, and snippets.

Forked from brendo/master.xml
Created March 15, 2019 07:44
What would you like to do?
<item id='1'>Fred</item>
<item id='2'>Jane</item>
<item id='3'>Bob</item>
<item id='4'>Mary</item>
<item id='6'>Tom</item>
<entry id='1'>
<entry id='2'>
<entry id='3'>
<entry id='4'>
<entry id='5'>
<entry id='6'>
<xsl:stylesheet xmlns:xsl="" version="1.0" xmlns:exsl="" extension-element-prefixes="exsl">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<xsl:variable name='folks'>
<xsl:for-each select='data/people/item'>
<xsl:copy-of select='/data/people-details/entry[@id = current()/@id and show = "Yes"]' />
<xsl:apply-templates select='exsl:node-set($folks)/entry[position() &lt; 3]' mode='show-people' />
<xsl:template match="entry" mode='show-people'>
<xsl:value-of select='name' />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment