[xsl] starts-with(preceding-sibling::line,8)

Subject: [xsl] starts-with(preceding-sibling::line,8)
From: "Keith" <keith@xxxxxxxxxxxxx>
Date: Wed, 11 Jul 2001 17:05:37 -0500
Good day everyone,
I had to move some logic from a VB component into several 'dedicated'
stylesheets. These files are coming in fixed-with, comma
delemited,quoted-comma etc.
the one in question is fixed-width and the order of the lines MUST be:
starting characters-
5, then any number of paired 6's and 7's followed by an 8

598e3983423   John Smith12334 PhoenixAZ55866   23423423  43545 345345345
632434890 other info
723423 other info
8234234324 ..............
then it starts with a 5 and continues

I already call to an Error template with parameters of the section of the
file (header,batch,transaction,trailer) and the contents of the line(node)
itself for lines of length less than is required, using <xsl:message
terminate="yes"> to generate the parseError reason.
all "line" nodes are children of a "Temp" root node
Now I want to call the same Error template IF the current line node
starts-with 5 but the preceding line node does not start with an 8

	<this is the part of the template select="line" section, after I test for
the starts-with 5 character and after the test is performed to assure the
proper line character length>

<xsl:if test="position()&gt;1 and not(starts-with(preceding::line,8)">'of
course the first line won't have a closing line behind it
	<xsl:call-template name="Error">
		<xsl:with-param name="errType">Header</xsl:with-param>
		<xsl:with-param name="errLine"><xsl:value-of select="."/></xsl:with-param>

I can't seem to combine the starts-with and the preceding or
preceding-sibling functions to make it work right. I always get a parserror
reason that the closing batch tag doesn't match the starting header tag (or
something to that effect). This would be fine if there was only one batch in
the file, however there can be thousands, so returning the actual line and
section really helps troubleshooting the error.

any help would be greatly appreciated.
thanks all

Keith Brooks
Software Developer
Global eTelecom

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread