Wednesday, April 25, 2012

How to Get all xml Items using xslt

Before doing this task i don't have an idea about xslt .Xslt is easy to learn and  to develop. Here i will show how to get the all XML items and display the items as list of anchor at client side view.For this i will use for loop to get the XML data

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">  
    <xsl:template match="/">
        <xsl:for-each select="List/Item">           
                    <xsl:attribute name="href">
                    <xsl:attribute name="title">
                    <xsl:attribute name="target">
                        <xsl:attribute name="src">
                            <xsl:value-of select="href"/>
                        <xsl:attribute  name="alt">
                            <xsl:value-of select="Title"/>
                        <xsl:attribute  name="class">
                            <xsl:value-of select="Title"/>
        </xsl:for-each>    </xsl:template>  
Post a Comment