![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XSLT evaluate XPath from a string XSLT evaluate XPath from a stringTo: NULL Date: 8/19/2008 1:19:00 PM I need to pull XPath from strings obtained from the XML data source. A typical query might look like: XML: <library> <books> <book title="A" type="science fiction"/> <book title="B" type="fantasy"/> <book title="C" type="romance"/> <book title="D" type="science fiction"/> <book title="E" type="Christianity"/> </books> <librarian> <defaultXPath>//book[type="Christianity"]</defaultXPath> </librarian> </library> XSLT (works): <xsl:variable name="Books"> <xsl:apply-templates select="//book[type="Christianity"]"/> </xsl:variable> XSLT (fails): <xsl:apply-templates select="//librarian/defaultXPath"/> <xsl:apply-templates select="{//librarian/defaultXPath}"/> The problem is that the apply-templates command process the string as a data island rather than interpreting the string as an XPath query. I have tried using code from EXSLT but that has not worked and everything I read suggests that XSLT 2.0 might have a method to perform this operation, but I find no examples. Any suggestions? | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
