![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Last position >Thread Next - Re: Last position Re: Last positionTo: NULL Date: 3/29/2008 1:44:00 PM
tshad wrote:
> So the last form would look something like:
>
> <form>
> <sectionNumber>1</sectionNumber>
> <primary>True</primary>
> <formName>1004</formName>
> <tagName>FormFormats</tagName>
> <flags>0</flags>
> <format>0</format>
> <value>NUM="1" FORMCODE="1004" SECCODE="1" DESC="" MAJOR="True"</value>
> </form>
This adds an additional form element
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="REPORT">
<xsl:copy>
<xsl:apply-templates select="FORMS/FORM/FIELDS/*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="FIELDS/*">
<form>
<sectionNumber><xsl:value-of
select="../../@SECCODE"/></sectionNumber>
<primary>True</primary>
<formName><xsl:value-of select="../../@FORMCODE"/></formName>
<tagName><xsl:value-of select="name()"/></tagName>
<value><xsl:value-of select="."/></value>
</form>
<xsl:if test="position() = last()">
<form>
<sectionNumber><xsl:value-of
select="../../@SECCODE"/></sectionNumber>
<primary>True</primary>
<formName><xsl:value-of select="../../@FORMCODE"/></formName>
<tagName>FormFormats</tagName>
<flags>0</flags>
<format>0</format>
<value>
<xsl:apply-templates select="../../@*"/>
</value>
</form>
</xsl:if>
</xsl:template>
<xsl:template match="FORM/@*">
<xsl:value-of select="concat(name(), '=', .)"/>
<xsl:if test="position() != last()">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
