[xslt] xslt extension for caching node-sets



Hi,


first: Iam very new to libxml/libxslt programming, and Iam also relatively new
to C Programming.

I tried to create some exslt-functions to cache nodesets (see the attached file)

First it seemed to work: (putting xml from the to be transformed stream in the
cache an reading it)

---
<xsl:if test="not(mp:testObject('mp'))">
    <xsl:value-of select="mp:putObject('mp',/root)"/>
</xsl:if>

<xsl:copy-of select="mp:getObject('mp')"/>
---

But this gives segfaults and other mysterious things (total currupt encoding)
(same linke above, but takes xml from a variable instead of the source xml)
---
<xsl:variable name="var"><test><dummy/></test><xsl:variable>
<xsl:if test="not(mp:testObject('mp'))">
    <xsl:value-of select="mp:putObject('mp',exslt:node-set($var))"/>
</xsl:if>

<xsl:copy-of select="mp:getObject('mp')"/>
---

also tried without exslt:node-set:
    <xsl:value-of select="mp:putObject('mp',$var)"/>
but also segfaulting (when getting the nodeset back via getObject).

maybe someone here can help me.

Thank you in advance !

Sebastian

mp.c



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]