In MOSS,list is ultimately stored in the database in the format of xml.
Now we can Modify list style through XSL.Fowlling the steps under below.
1. Create a custom list named podcasts.
2. Create a new page(A.aspx) with Blank Web Part Page Layout. Then Drag this podcasts list into webpart zone of this page. DataView Webpart will show all datas about this podcasts list. Modify to show fields that needed.
3. Then copy XSLT code in DataView Webpart, modified the xslt code.
xslt code:
<
xsl:stylesheet xmlns:x = " http://www.w3.org/2001/XMLSchema " xmlns:d = " http://schemas.microsoft.com/sharepoint/dsp " version = " 1.0 " exclude-result-prefixes = " xsl msxsl ddwrt " xmlns:ddwrt = " http://schemas.microsoft.com/WebParts/v2/DataView/runtime " xmlns:asp = " http://schemas.microsoft.com/ASPNET/20 " xmlns:__designer = " http://schemas.microsoft.com/WebParts/v2/DataView/designer " xmlns:xsl = " http://www.w3.org/1999/XSL/Transform " xmlns:msxsl = " urn:schemas-microsoft-com:xslt " xmlns:SharePoint = " Microsoft.SharePoint.WebControls " xmlns:ddwrt2 = " urn:frontpage:internal "
>
<
xsl:output method = " html " indent = " no "
/>
<
xsl:decimal-format NaN = ""
/>
<
xsl:param name = " dvt_apos " > ' </ xsl:param
>
<
xsl:variable name = " dvt_1_automode " > 0 </ xsl:variable
>
<
xsl:template match = " / "
>
<
xsl:call-template name = " dvt_1 "
/>
</
xsl:template
>
<
xsl:template name = " dvt_1 "
>
<
xsl:variable name = " dvt_StyleName " > Table </ xsl:variable
>
<
xsl:variable name = " Rows " select = " /dsQueryResponse/Rows/Row "
/>
<
table border = " 0 " width = " 100% " cellpadding = " 2 " cellspacing = " 0 "
>
<
xsl:call-template name = " dvt_1.body "
>
<
xsl:with-param name = " Rows " select = " $Rows "
/>
</
xsl:call-template
>
</
table
>
</
xsl:template
>
<
xsl:template name = " dvt_1.body "
>
<
xsl:param name = " Rows "
/>
<
xsl:for-each select = " $Rows "
>
<
xsl:call-template name = " dvt_1.rowview "
/>
</
xsl:for-each
>
</
xsl:template
>
<
xsl:template name = " dvt_1.rowview "
>
<
tr
>
<
xsl:if test = " position() mod 2 = 1 "
>
<
xsl:attribute name = " class " > ms-alternating </ xsl:attribute
>
</
xsl:if
>
<
td class = " ms-vb " width = " 1% " nowrap = "" rowspan = " 3 "
>
<
a
>
<
xsl:attribute name = " href "
>
/B.aspx?itemId=
< xsl:value-of select = " @ID "
/>
</
xsl:attribute
>
<
img border = " 0 " width = " 50 " height = " 50 " src = " {substring-before(@Picurl, ', ')} " alt = " {substring-after(@Picurl, ', ')} "
/>
</
a
>
</
td
>
<
td class = " ms-vb "
>
<
xsl:value-of select = " @Title "
/>
</
td
>
</
tr
>
<
tr
>
<
td style = " font-size:12px; "
>
<
xsl:value-of select = " ddwrt:FormatDateTime(string(@Created) ,1033 ,'MMMM dd, yyyy ') "
/>
</
td
>
</
tr
>
<
tr
>
<
td style = " font-size:12px; "
>
<
xsl:choose
>
<
xsl:when test = " string-length(@Description) > 80 "
>
<
xsl:value-of select = " substring(@Description, 1,77) " disable-output-escaping = " yes "
/>
</
xsl:when
>
<
xsl:otherwise
>
<
xsl:value-of select = " @Description " disable-output-escaping = " yes "
/>
</
xsl:otherwise
>
</
xsl:choose
>
</
td
>
</
tr
>
</
xsl:template
>
</
xsl:stylesheet
>
referrence:
http://www.cnblogs.com/jaxu/archive/2009/08/18/1548259.html
New: <img alt="" border ="0">
<xsl:attribute name="src">
../../Style Library/Images/<xsl:value-of select="substring-before(substring-after($Url,'/'),'/')"/>/en.JPG</xsl:attribute>
</img>