Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: dynamic generate the document() function

Reply
Thread Tools

Re: dynamic generate the document() function

 
 
Marrow
Guest
Posts: n/a
 
      07-07-2003
Hi Jens,

"Jens Heinrich" <(E-Mail Removed)> wrote in message
news:be9meq$g89$07$(E-Mail Removed)-online.com...
> I have some problem.
> The document() Function with fix parameter works very well:
>
> <xsl:value-of select="document('test.xml')//Name/FirstName"/>
>
> ...but I have the path of the context node and want to set this path
> dynamicly to this
> function.
> The path are saved in the variable xpath.
>
> I want to build some statement like:
> <xsl:value-of select="document('test.xml') + $xpath"/> (perhaps, the
> "+"doesn't work)
> to get the value of the node.
>
> <xsl:value-of select="document(('test.xml'),$xpath) "/> doesn't work.
>


Firstly, this has nothing to do with the document() function really.

None of what you are trying will work - there is no syntax for doing this
because it cannot be done in XSLT+XPath. IOW, XSLT and XPath cannot macro
evaluate a string as an XPath expression.

However, some transformation engines do have extension functions that might
enable you to do this (e.g. the evaluate() extension function in some
engines) - but of course this makes the XSLT code less portable.

Cheers
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to generate a user instance of SQL Server. Only an integratedconnection can generate a user instance. Harlan Messinger ASP .Net 2 03-28-2010 06:51 PM
How to generate warnings when How generate a warning when int is converted to bool or vice versa? PengYu.UT@gmail.com C++ 3 04-06-2006 11:24 PM
How to generate variable labels for same component within a generate loop Weng Tianxiang VHDL 5 02-16-2006 01:45 PM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
How to generate dynamic XML from aspx page =?Utf-8?B?Um9ic29uIENhcnZhbGhvIE1hY2hhZG8=?= ASP .Net 1 08-24-2004 02:33 AM



Advertisments