Dangerboy3D
New Member
I am trying to use increment in XSLT. and write the output to txt file.Here's my code:Xslt code:\[code\]<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xslutput method="text"/> <xsl:template match="/"> </xsl:template> <xsl:template match="/build/build"> <xsl:variable name="buildNumber" select="."/> <xsl:element name="build"> <xsl:value-of select="$buildNumber + 1"/> </xsl:element> </xsl:template> <xsl:template match="/|@*|node()"> <xsl:value-of select="build/major"/> <xsl:value-of select="build/minor"/> <xsl:value-of select="build/build"/> <xsl:value-of select="build/release"/> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template></xsl:stylesheet>\[/code\]XML code is:\[code\] <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="http://stackoverflow.com/questions/15706498/E:/Build/genVer.xsl"?> <build> <major>1.</major><minor>0.</minor><build>0</build><release>.0</release> </build>\[/code\]I tried using \[code\]<xsl:result-document>\[/code\] it gives error saying \[code\]<xsl:result-document>\[/code\] cannot be child of \[code\]<xsl:stylesheet>\[/code\] or \[code\]<xsl:template>\[/code\]. Thankyou