Hen*_*ker 11 tridion tridion2009
真的很简单的问题,但我似乎无法让它正常工作.
我有一个组件,其中有一些XSLT(用于导航).它通过XSLT TBB使用XSLT Mediator发布.
在发布< 变为<,并打破xslt ...
组件内容(纯文本字段)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" exclude-result-prefixes="tcm xsl xs xlink tridion">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:apply-templates select="/node/node[@type='folder')='0' and position() < 3]">
<xsl:sort select="sortnum"/>
</xsl:apply-templates>
<xsl:template match="node">
<xsl:text>Lorem Ipsum</xsl:text>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
XLT CT TBB输出此组件:
<xsl:stylesheet version="1.0" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tridion="http://www.tridion.com/ContentDelivery/5.3/TCDL" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:helper="http://www.tridion.com/xslthelper" xmlns:systeemcode="http://www.indivirtual.nl/SysteemCode" xmlns:xhtml="http://www.w3.org/1999/xhtml" exclude-result-prefixes="tcm xsl tridion xlink systeemcode xslthelper helper xhtml">
<xsl:output method="text" omit-xml-declaration="yes" indent="yes" encoding="utf-8" standalone="no"/>
<xsl:variable name="content" select="/tcm:Component/tcm:Data/tcm:Content/systeemcode:SysteemCode"/>
<xsl:template match="/">
<xsl:value-of disable-output-escaping="yes" select="helper:HtmlDecode($content/systeemcode:code)"/>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
输出CP的XSLT页面TBB:
<xsl:stylesheet version="1.0" xmlns:helper="http://www.tridion.com/xslthelper" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="tcm:ComponentPresentation">
<xsl:value-of select="helper:GetRenderedComponent(./tcm:Component/@xlink:href, ./tcm:ComponentTemplate/@xlink:href)" disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
这个问题在CT TBB中找到了(感谢@ChrisSummers).
输出此组件的XSLT CT TBB引用了一个XSLT介体HTMLEncoding helper:HtmlDecode()方法,该方法适用于普通文本,但不适用于XSLT.我删除它并解决问题:
<xsl:stylesheet version="1.0" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tridion="http://www.tridion.com/ContentDelivery/5.3/TCDL" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:helper="http://www.tridion.com/xslthelper" xmlns:systeemcode="http://www.indivirtual.nl/SysteemCode" xmlns:xhtml="http://www.w3.org/1999/xhtml" exclude-result-prefixes="tcm xsl tridion xlink systeemcode xslthelper helper xhtml">
<xsl:output method="text" omit-xml-declaration="yes" indent="yes" encoding="utf-8" standalone="no"/>
<xsl:variable name="content" select="/tcm:Component/tcm:Data/tcm:Content/systeemcode:SysteemCode"/>
<xsl:template match="/">
<xsl:value-of disable-output-escaping="yes" select="$content/systeemcode:code"/>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
241 次 |
| 最近记录: |