1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

XSLT, using a string value as a node-set() param

Discussion in 'Microsoft News' started by NewsBot, Mar 30, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    Hi everyone,
    Apologies if this is off-topic..

    I am writing an XSLT where I want to pass an XPath statement in as a parameter.* Like so:



    Note the single quotes around the XPath - the param is a string literal, not a node set.

    I then want to go:




    But ASP.Net doesn't like this at all, in fact my web server crashes as soon as it attempts the transform. XMLSpy doesn't like it either. It works fine when I declare the param like this:



    Can anyone tell me if there's a way to get it to do what I want, or a workaround?

    As background, I'm doing this because I need to calculate the XPath on the fly based on the current URL. It's basically a kind of URL rewriter - I'll convert /mypages/mypage.htm to /pagegroup[@title='mypages']/page[@title='mypage']




     

Share This Page