Pregunta

Ahora hago un webpart con XSLT cuando solo muestro datos, pero no sé si es mejor hacerlo con código .Net.

por ejemplo en XSLT:

XSLT y SharePoint – Parte 1 "]\"XS

XSLT y SharePoint – Parte 2 "]\"XS

¿Cuál es la ventaja de hacerlo en .Net o XSLT?

¿Ya se usa el XSLT en SharePoint 2013?

¿Fue útil?

Solución

Desarrollar un elemento web en Visual Studio es mucho mejor que usar XSLT, ya que le brinda control total sobre lo que está haciendo.XSLT es limitado y SharePoint solo admite XSLT versión 1.0.

Por ejemplo, si está mostrando una lista o biblioteca de algún otro sitio, necesitará usar el elemento web de consulta de contenido (CQWP) y, en este caso, aplicar XSLT no es fácil.

EDITAR

Digamos que tienes una lista con dos columnas;Título y Nombre.Y desea mostrarlos en una tabla HTML, entonces será algo como esto:

<!--
This section is the set up and can be used at the top of any external XSLT stylesheet file
-->
<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"/>
<!--
End of Set Up
-->

<table>
    <tr>
        <td>Title: <xsl:value-of select="@Title" /></td>
    </tr>

    <tr>
        <td>Name: <xsl:value-of select="@Name" /></td>
    </tr>
</table>

</xsl:stylesheet>
Licenciado bajo: CC-BY-SA con atribución
scroll top