Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - XSLT evaluate XPath from a string >Thread Next - Re: XSLT evaluate XPath from a string Re: XSLT evaluate XPath from a stringTo: NULL Date: 8/20/2008 8:17:00 AM XSLT 2.0 has no facility to do this either. Some processors have extension functions built in that do this, Saxon for instance has saxon:evaluate(). If you are using MSXML you can write an extension function in script, if using XML.NET then you can use a .NET language. It also might be useful to see what you tried in EXSLT that failed. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name "Mycroft" <Mycroft@d...> wrote in message news:C00EE749-5633-46D5-A51F-64351B23028A@m...... >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 | Mobile | Full Site | |||
|
