Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Vexing problem processing a list of error messages >Thread Next - Re: Vexing problem processing a list of error messages Re: Vexing problem processing a list of error messagesTo: NULL Date: 10/5/2006 6:45:00 PM What a terrible XML representation... Anyway I don't know how much you need but to select the A: types you need: /message/text[starts-with(., 'A:')] and for B: ones: /message/text[starts-with(., 'B:')] So create an XSLT that use xsl:apply-templates to these two selections. In a matching template for A: <xsl:template match="text[starts-with(., 'A:']"> you can add the HTML markup and similarly for the B: group. -- Joe Fawcett - XML MVP http://joe.fawcett.name "hoosie" <hoosiemama@g...> wrote in message news:1160068248.047346.177960@i...... >I am trying to process a list of error messages of two different types. > They arrive as such: > > <message> > <text>A:SOMEERROR</text> > <text>A:SOMEOTHER</text> > <text>B:ANOTHER</text> > <text>A:ANDANOTHER</text> > </message> > > The error type is denoted by a code like A or B followed by a colon and > some other descriptor. There can only be 1 type B error, and what I > need to do in pseudocode would be: > > { > If there are any A errors, draw a yellow box > for each A error, write the text into the box > end if > > If B error, write a bunch of static HTML > } > > I am quite stumped as to how to do this, as it involves iterating > through the list once before to find out if there are any type A errors > (ie draw the box), and I am pretty new to XSL, and I don't know whether > to use variables, keys, templates, etc. Any help GREATLY appreciated! > > Thanks, Ian > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
