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

Subject: RE: [xsl] starts-with(preceding-sibling::line,8)
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Thu, 12 Jul 2001 08:58:35 +0100
Since the error message relates to a "batch" tag, and there aren't any
<batch> tags in the pieces of XML source and stylesheet that you've shown
us, it's reasonable to assume that the error is in a part that you haven't
shown us.

Are you trying to run this in the browser? If so, that's the worst possible
debugging environment. Get your self a processor that you can run from the
command line.

Mike Kay
Software AG

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Keith
> Sent: 11 July 2001 23:06
> To: Xsl-List (E-mail 2)
> Subject: [xsl] starts-with(preceding-sibling::line,8)
> 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
> example:
> 598e3983423   John Smith12334 PhoenixAZ55866   23423423
> 43545 345345345
> 632434890 other info
> 723423 other info
> 6......
> 7......
> 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>
> 	</xsl:call-template>
> </xsl:if>
> 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
> Keith@xxxxxxxxxxxxxxxxxx
>  XSL-List info and archive:

 XSL-List info and archive:

Current Thread