Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: 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 12:06:00 PM
Joe Fawcett wrote:
> What a terrible XML representation...
Thanks Joe, with your help I'm making some progress. It truly is an
irritating representation, the list should have been split under two
nodes in the first place.
I am having two strange problems though right now (I am using Cooktop
to test this). First is that the template is returning the opposite of
what I expect. When I run the code below my result is all of the A:
text, not the MG: text which is what I thought I was matching.
Secondly, If I try to put a second template below this one, my output
is blank. Is there a limit on how many templates can use which nodes?
Thanks again, Ian
With input:
<?xml version="1.0" encoding="utf-8"?>
<message>
<text>A:SOMEERROR</text>
<text>A:SOMEOTHER</text>
<text>MG:ANOTHER</text>
<text>A:ANDANOTHER</text>
</message>
and XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="text[starts-with(., 'MG:')]">
<xsl:for-each select="text">
<xsl:value-of select="text"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
OUPUT in CookTop:
A:SOMEERRORA:SOMEOTHERA:ANDANOTHER
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
