in

ASP.NET Weblogs

guyS's WebLog

IShare, My DotNet Fingerprint

Using XSL Transform with Objects Extension[framework2]

In continue to the previous post here is another great walkthrough by ftponline web site author Thiru Thangarathinam regard XSLT performance but I find it also focus on object extensions during XSL transform process. This time its being done using the new XslCommand class that ship with Framework2 and is the core class for dealing with XSLT transformations.

Here is a snippet of it

XsltCommand command = new XsltCommand();
//Compile the XSL stylesheet
   command.Compile(Server.MapPath
   ("ProductsPaging.xsl"));
XmlArgumentList argsList = new
   XmlArgumentList();
//Retrieve the pageNumber from //querystring
int pageNumber = Convert.ToInt32(
   Request.QueryString["pagenumber"]);
//Add the required parameters to the XmlArgumentList object
argsList.AddParameter
   ("recordsPerPage", "", 10);
argsList.AddParameter
   ("pageNumber", "", pageNumber);
argsList.AddParameter
   ("recordCount", "", 77);
//Instantiate the object to be added to the
//XsltArgumentList object
BGColor obj = new BGColor();
   argsList.AddExtensionObject
   ("urn:myColor",obj);
command.Execute(xpathDoc, null, argsList,
      Response.Output);

I guess that we will be able to see more and more object extensions in our applications for validations, filtering & sorting according to a set of rules, different text formatting and such. 

One of the intensive usage I can see for object extension will be in Yukon, which is the code name for the next SQL Server. Yukon introduce a new table field type of Xml. Its also enable us to use our assemblies for processing data within the database itself. This mean we could get our Xml data from a table field, process it in our assembly using XSL with object extensions and return it to our client - and do it all within our DB

XML processing within Yukon can also be done using internal set of XQuery language that is part of Yukon. So we can now choose the best processing method for our problem. 

Published Jan 07 2005, 02:32 AM by guyS
Filed under:

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add