hi-
i am fooling around with soap and weather templates.
for some reason either this if or select is failing.
i am very new to xml and found this code at another site.
i can show you the xml and then the xslt sample code that is not matching.
please look and if it jumps right off the page give me a tip on why it didnt
select the data.
i think for most xslt people this will be easy. i want the if to work if it
is null because
the weather service may return null for an attribute.
from the government weather service:
<weather time-layout="k-p24h-n5-1">
<name>Weather Type, Coverage, and Intensity</name>
<weather-conditions weather-summary="Increasing Clouds"/>
<weather-conditions weather-summary="Partly Cloudy"/>
<weather-conditions weather-summary="Partly Cloudy"/>
<weather-conditions weather-summary="Mostly Sunny"/>
<weather-conditions weather-summary="Chance Rain Showers">
<value coverage="chance" intensity="light" weather-type="rain
showers" qualifier="none"/>
</weather-conditions>
</weather>
from a sample template i found:
<xsl:template name="weather">
<xsl:param name="position" />
<xsl:if
test="/dwml/data/parameters/weather/weather-conditions[position()=$position]/@weather-summary
!=''">
<xsl:value-of
select="/dwml/data/parameters/weather/weather-conditions[position()=$position]/@weather-summary"/>
</xsl:if>
</xsl:template>
other parts of the templates are generating output (not formatted yet
though)
assuming that the path is correct and it looks like it is, why wont this
match?
@weather-summary is the attribute that has a value associated with it that
is not null.
the path from the root looks ok....
i want to get into learning a little bit more about xml and xslt.
i have a book on it and am currently studing a css book too.
i like the fact that when i combine all the templates with html i can have
it output
the results formatted. i need to get better at the xslt processing.
thanks very much.
i hope you are enjoying the weekend too.
jim (website - 3rdshiftcoder.com)