katyakrog
Новичок
F1please! XML & XSLT & PHP
есть файл xml кот обрабатывается xsl шаблоном, в который через xsltProcessor->setParameter() передается переменная;
--------------
в php файле пишу:
xsltProcessor->setParameter('', 'text', '//items/item[@id=1] /')
------------------
в xsl:
<xsl
aram name="text" />
…
<xsl:value-of select="$text" />
------------------
ВЫВОДИТ - саму строку "//items/item[@id=1]/", а не элементы item[@id=1]/
-------------------
в php:
// xsltProcessor->setParameter('', 'text', '//items/item[@id=1]/')
------------------
в xsl:
<xsl
aram name="text" select="//items/item[@id=1]/" />
…
<xsl:value-of select="$text" />
------------------
все ок выводит элементы //items/item[@id=1]/
-------------------------------------------------
ОБЪЯСНИТЕ В ЧЕМ РАЗНИЦА !!!!?????????
есть файл xml кот обрабатывается xsl шаблоном, в который через xsltProcessor->setParameter() передается переменная;
--------------
в php файле пишу:
xsltProcessor->setParameter('', 'text', '//items/item[@id=1] /')
------------------
в xsl:
<xsl

…
<xsl:value-of select="$text" />
------------------
ВЫВОДИТ - саму строку "//items/item[@id=1]/", а не элементы item[@id=1]/
-------------------
в php:
// xsltProcessor->setParameter('', 'text', '//items/item[@id=1]/')
------------------
в xsl:
<xsl

…
<xsl:value-of select="$text" />
------------------
все ок выводит элементы //items/item[@id=1]/
-------------------------------------------------
ОБЪЯСНИТЕ В ЧЕМ РАЗНИЦА !!!!?????????