How do I change the value in an XsltArgumentList

Published 14 September 04 02:44 AM

I encountered a customer today with a question.  Remember I am at BorCon this week.

The question was around the XsltTransform and using parameters.  So I quickly looked up the object and the method of Tranform and found that indeed I could pass parameters in an XsltArgumentList.  Now the question was this.  If I am using the same xslt and the same parameters (obviously), but want to just change the value of the parameter for another run, how do I do this?

So I looked up the XsltArgumentList and found that there is an AddParam, and a GetParam, and a RemoveParam, but there no reference to an indexer, or anything that would allow me to change the value of the parameter without doing a RemoveParam and an AddParam.  Then there is the curious  GetParam and it returning an Object instead of a type of like say XsltArgument so that you can just change the value or the namespace without removing and re-adding with a new value.

Are there any takers?  I could not find anything on it and it would be great to learn a little more about a space that I have little experience in.

Comments

# oleg@tkachenko.com (Oleg Tkachenko) said on September 14, 2004 5:02 AM:
I don't think anything can be done here. Looks like it's by design and moreover XsltArgumentList is sealed so no extension is possible.
Params and extension objects can't be changed, only removed and added again.
# anonymouse said on September 14, 2004 8:59 AM:
Hi Ben,

I've worked with this by removing then "readding".

The interesting thing about AddParam is not just that it returns an object, but that the AddParam object should be one of 5 or 6 distinct types.

Maybe a type could be passed in with the parameter - but you could just do typeof(paramObj) anyway I suppose.

Whatever way you look at it, the model is basically the same (although syntactically neater and easier to use) as the "old" approach: the "xslProcessor" object in the "old" MSXML2.XSLTemplate class I used in VB.

Sorry I can't be more helpful... maybe derive from XsltArgumentList or write a wrapper to do this?
Anonymous comments are disabled

This Blog

Syndication

Page view tracker