Как подключить функции XPath в XSLT?
От: byleas  
Дата: 24.11.09 16:20
Оценка:
Сабж.
То ли неправильное пространство имён (хотя везде видел именно в таком виде), то ли я чего-то не понимаю.
Пример:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions">
    <xsl:output method="xml" standalone="yes" encoding="utf-8" indent="yes"/>

    <xsl:template match="/">
        <xsl:element name="fn">
            <xsl:attribute name="empty">
                <xsl:value-of select="function-available('fn:empty')"/>
            </xsl:attribute>
            <xsl:attribute name="exist">
                <xsl:value-of select="function-available('fn:exists')"/>
            </xsl:attribute>
        </xsl:element>
    </xsl:template>

</xsl:stylesheet>


Проверял на MSXML6, xsltproc (libxml 20627, libxslt 10119 and libexslt 813)

xsltValueOf: select function-available('fn:exists')
Lookup function {http://www.w3.org/2005/xpath-functions}exists
xsltCopyTextString: copy text false
xsltValueOf: result 'false'

xslt
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.