Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: xsl:if test for empty tag [Thread Next] Re: xsl:if test for empty tagTo: NULL Date: 10/6/2005 6:43:00 PM Sorry, you are right and it works. Your sample missed the closing backslash and I was so mesmerised by the errro message I didn't notice. thanks very much jc. -- =============== Jonathan Crawford jc@t... =============== "Grinder" <grinder@n...> wrote in message news:QEc1f.401633$x96.252166@attbi_s72... > Jonathan Crawford wrote: >> Hi >> >> I am perilously new at this. >> I have an xml file which may >> or not return an image in an <image> tag >> If there is no image there is no tag >> (though I could have an empty tag) >> >> I figure I should do something like this >> >> <xsl:if test="@image <> null"> >> <img> >> <xsl:attribute name="src"> >> <xsl:value-of select="image"/> >> </xsl:attribute> >> </img> >> <xsl:if> >> >> but I am just gusessing as no samples I can find >> do anything like this. I would be grateful for some help >> as I have been stuck for hours > > Try this: > > <xsl:if test="image"> > <img> > <xsl:attribute name="src"> > <xsl:value-of select="image"/> > </xsl:attribute> > </img> > <xsl:if> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
