Selecting Element Attribute in XSLT

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi I have the following XML: <?xml version="1.0" encoding="utf-8" ?> <MurNews Title="LATEST NEWS <News> <TITLE>Sample News 1</TITLE> <ITEM>Tobey Maguire</ITEM> <HREF>www.mywebsite.in</HREF>
</News> <News> <TITLE>The Pink Panther</TITLE> <ITEM>Steve Martin</ITEM> <HREF>www.someotherwebsite.com</HREF> </News> </MurNews> And I use the following XSLT to generate a HTML snippet: <?xml
version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" >
<xsl:output method="html" indent="yes"/> <xsl:template match="/
<xsl:value-of select="@Title"/>
<marquee behavior="scroll" direction="up" scrollamount="1" height="100" width="350 <xsl:for-each select="MurNews/News
<xsl:value-of select="TITLE"/> <xsl:value-of select="ITEM"/>
<a><xsl:attribute name="href <xsl:value-of select="HREF"/> </xsl:attribute> Read More >>;

</xsl:for-each> </marquee >
</xsl:template> </xsl:stylesheet> When I transform this using C#, I get only blank value for
, whereas it should be "LATEST NEWS". The idea is I need to scroll news items into a marquee element. Any idea where I went wrong? Thanks

<
Sathya

View the full article
 
Back
Top