Doing this causes a traceback to be thrown:
<xsl:variable name="start_portlet_title">
<xsl:text>
<![CDATA[
<div class="ambitios_title">
<div class="ambitios_title_left">
<div class="ambitios_title_right">
]]>
</xsl:text>
</xsl:variable>
<xsl:variable name="end_portlet_title">
<xsl:text>
<![CDATA[
</div>
</div>
</div>
]]>
</xsl:text>
</xsl:variable>
<xsl:value-of select="$start_portlet_title"/>
<xsl:value-of select="$collage-cell"/>
<xsl:value-of select="$start_portlet_title"/>
And the traceback:
2011-02-11 15:57:46 ERROR plone.transformchain Unexpected error whilst
trying to apply transform chain
Traceback (most recent call last):
File
"/home/tzicatl/Aplicaciones/Buildout/egss/plone.transformchain-1.0b1-py2.6.egg/plone/transformchain/transformer.py",
line 42, in __call__
newResult = handler.transformIterable(result, encoding)
File
"/home/tzicatl/Aplicaciones/Buildout/egss/collective.xdv-1.0rc11-py2.6.egg/collective/xdv/transform.py",
line 285, in transformIterable
transformed = transform(result.tree)
File "xslt.pxi", line 556, in lxml.etree.XSLT.__call__
(src/lxml/lxml.etree.c:110044)
XSLTApplyError: XPath evaluation returned no result.
2011/2/11 Noe Misael Nieto Arroyo <[email protected]>
> I'm trying to create a xsl:function that outputs the value of a xpath
> selector sorrounded with some boilerplate code (html <div/> elements). Upon
> calling the function, the content of the xpath selector makes it to the html
> output, but not the boilerplate code.
>
> Here's the xml stylesheet:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <rules
> xmlns="http://namespaces.plone.org/xdv"
> xmlns:css="http://namespaces.plone.org/xdv+css"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:iservices="http://namespaces.iservices.mx/"
> >
>
> <!--Declare function that outputs wrapping divs for portlet layouts-->
> <xsl:function name="iservices:as_portlet_layout" as="xs:string">
> <xsl:param name="selector"/>
> <div class="boilerplate_1">
> <div clas="boilerplate_2">
> <xsl:copy-of select="$selector"/>
> </div>
> </div>
> </xsl:function>
>
> <xsl:value-of
> select="iservices:as_portlet_layout(/some/expath/selector)"/>
>
> </rules>
>
> The Value of /some/expath/selector makes it to the rendered html on the
> browser, but not the rest of the boilerplate code. I also tryied to use
> xsl:text, but with the same results:
>
> <xsl:function name="iservices:as_portlet_layout" as="xs:string">
> <xsl:param name="selector"/>
> <xsl:text><![CDATA[<div class="boilerplate_1">]]></xsl:text>
> <xsl:text><![CDATA[ <div clas="boilerplate_2">]]></xsl:text>
> <xsl:copy-of select="$selector"/>
> <xsl:text><![CDATA[ </div>]]></xsl:text>
> <xsl:text><![CDATA[</div>]]></xsl:text>
> </xsl:function>
>
> Using xdv 0.4b3 on Plone4. What am I doing wrong?
>
_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/product-developers