I have the following .xml with the following struncture <records> <record> <author> <event_time> .... </record> ... I then whish to transfer it to text to be included within an email. Im trying to align all the columns so that the document is easier to read. So Im attepting to read the element and check if its of length 20 and if not keep looping adding whitespaces until you reach 20. My problem now is that nothing happens. Where am I going wrong in my xsl document. Thank you for your time
The line causing the problem is the <xsl:apply-templates select="records"/>. and you don't have the template for 'records' defined anywhere. Try changing this to: <xsl:apply-templates select="author"/> or create a template for 'records' and call the 'author' template eith the corresponding parameter. All the best. Dhananjay.
Joined: Nov 03, 2000
I tried the following and i still get no output Any ideas? <xsl:template match="/"> <xsl:for-each select="records/record"> <xsl:apply-templates select="author"/> </xsl:for-each> </xsl:template>
It can be easier to define a variable of 20 blanks <xsl:variable name="twentyBlanks"> *</xsl:variable> (doesn't work without "*" at the end) and then cut as many blanks as you need to lengthen your aut variable: <xsl:variable name="test" select="concat( $aut, substring($twentyBlanks, 1, 20 - string-length($aut)) )"/>* [ March 10, 2003: Message edited by: Mapraputa Is ]