<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*" />
<xsl:output method="xml" indent="yes" encoding="UTF-8" />
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="fields">
<form>
<xsl:apply-templates
select="field[preceding-sibling::field[(_at_)name='name']][following-sibling::field[(_at_)name='favFood']]"
/>
</form>
</xsl:template>
<xsl:template match="field">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: Steve <subsume(_at_)gmail(_dot_)com>
Sent: Wed, 28 Mar 2007 12:49:52 -0400
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Something like position()
I'm making an xsl template which takes a SQL table's info and
automates form display based on data types, field order, etc.
Given something like
<fields>
<field name="name" />
<field name="city" />
<field name="state" />
<field name="zip" />
<field name="favFood" />
</fields>
---
Above, I'd like only the nodes which are after @name="city" and before
@name="favFood".
Let's say, for example, I wanted to add zipPlusFour after "zip" and
before "favFood". I'd want my xsl to 'know' to this field belongs in
the form. Looking for output something like...
<form>
<city>
<state>
<zip>
</form>
-Steve
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--