Ustawienie xsl: value - of do atrybutu href i pola tekstowego łącza w XSLT
Jak mogę ustawić href, który jest zarówno łączem do, jak i ma tekst dla łącza poprzez transformację XSLT? Oto, co mam do tej pory, co daje mi błąd "xsl: value-of nie może być potomkiem elementu xsl: text":
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="actionUrl"/>
</xsl:attribute>
<xsl:text><xsl:value-of select="actionUrl"/></xsl:text>
</xsl:element>
31
3 answers
<xsl:text>
definiuje sekcję tekstową w dokumencie XSL. Tylko prawdziwy, zwykły tekst może przejść tutaj, a nie węzły XML. Potrzebujesz tylko <xsl:value-of select="actionUrl"/>
, Która i tak wydrukuje tekst.
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="actionUrl"/>
</xsl:attribute>
<xsl:value-of select="actionUrl"/>
</xsl:element>
37
Author: zneak,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-04-01 19:21:57
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-04-01 19:21:57
Możesz również zrobić:
<a href="{actionUrl}"><xsl:value-of select="actionUrl"/></a>
27
Author: lexicore,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-04-01 20:56:30
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-04-01 20:56:30
Nie potrzebujesz elementu xsl:text
:
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="actionUrl"/>
</xsl:attribute>
<xsl:value-of select="actionUrl"/>
</xsl:element>
4
Author: Oded,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-04-01 19:21:12
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-04-01 19:21:12