473,382 Members | 1,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Request: Checking XsltArgumentList for item presence

Hello!

I would like to request a new method on the XsltArgumentList class, allowing
developers to check the presense of a key/value pair. If you try to add a
key/value pair that has already been defined in the list, an exception is
thrown.

Rather than using the "GetParam" method, it would be usefull to have a
method called ".Exists" available on the XsltArgumentList. I think this
allows for cleaner and more readable code. Or, perhaps even better - an
overloaded "AddParam" that allows you to force an existing key/value pair to
be overridden with a new value.

Imagine a class API that provides an XsltArgumentList populated with the
contents of the Request.QueryString collection (and possible the
Request.Form too). The XsltArgumentList object is then passed to an
XsltTransform object, allowing the Xslt document to reference all the
key/value pairs.

Without making changes to the C# code, the developer has got an easiy way to
pass data forth and back between the Xslt document.

However, in the class API that builds the XsltArgumentList, an exception is
thrown if an equal key/value pair is defined in both the Request.QueryString
and Request.Form collection.

Comments are welcome!

The code below illustrates the current implementation:

C#:
XsltArgumentList RequestArgList = new XsltArgumentList();

// Iterate QueryString collection
foreach (string thisKey in Request.QueryString)
{
// The current key is not defined in the list
if (RequestArgList.GetParam(thisKey, "") == null)
{
// Add current key to list
RequestArgList.AddParam(thisKey, "",
Request.QueryString[thisKey].ToString());
}
}

I'd like to do the following:

C#:
XsltArgumentList RequestArgList = new XsltArgumentList();

// Iterate QueryString collection
foreach (string thisKey in Request.QueryString)
{
// The current key is not defined in the list
if (RequestArgList.Exists(thisKey) == false)
{
// Add current key to list
RequestArgList.AddParam(thisKey, "",
Request.QueryString[thisKey].ToString());
}
}
--
venlig hilsen / with regards
anders borum
--
Nov 11 '05 #1
0 3069

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Robert Mark Bram | last post by:
Hi All! I have the following code in an asp page whose language tag is: <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> // Find request variables. var edition = Request.Form ("edition"); var...
67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
5
by: Tim Menninger | last post by:
I have seen the postings about passing XML into an XSL transformation. The problem is that I cannot use any XPath navigation in the XSL that won't generate an error. If I use <xsl:copy-of...
1
by: NicoAgenci | last post by:
Hello, I have a page in .net (DEFAULT.ASPX), i load a XmlDocument, and a XslTransform to Add a XsltArgumentList (with the param : urlPage), and send all to a <asp:xml> in the page. The...
1
by: chris yoker via DotNetMonster.com | last post by:
hiya, I add new nodes to an xmlDoc. I want to add "innerText" to every newly-created node. current XML file <code> <rows> <row> <PRODUCT-TYPE>bike</PRODUCT-TYPE>...
0
by: Maciek | last post by:
Hi When I set Session state mode to StateServer (IIS 6.0; windows2003; .NET 2.0) in my application, I have recived this message:...
0
by: Chris Crowe [MVP 2005/2006] | last post by:
I have written a Web User Control that runs inside of Sharepoint, but when I want to use a custom convertor class to convert an XML attribute I get the following error: ...
0
by: Hulk | last post by:
I have problems passing parameters from C# application to XSL file and doing a transformation. My code is below.: XsltArgumentList xslArg = new XsltArgumentList(); String key =...
2
by: joer.banno | last post by:
Hi, In a webapp I'm writing I need to know if another webapp is running (both of which are asp.net), is there a way that you can check for the presence of another webapp? The problem is that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.