Yes, that article does look familiar!
I tried this before and had to abandon it for the time being.
But, I HAVE IT WORKING NOW!!!
Here is how to do it:
Remember, I have wrapped the GoView functionality in a user control…
In the XSLT file, within the <xsl:stylesheet > tag, you should declare the user control “name space” with the “remove” parameter. Here is the one I have in my file:
<xsl:stylesheet version=“1.0” xmlns:asp=“remove”
Then, wherever you want the control to appear, you include the control declaration in the XSLT. In my case, like this:
<cc1:FlowChart ID=“FlowChart1” runat=“server”></cc1:FlowChart>
In the asp.net page that uses the transformation, I do the following:
I call out to a data service that returns the xml data for the page. I apply the XSLT transformation like so:
XmlNode xnode = srvc.GetObject(Int32.Parse(tmp)); //srvc is the data service object, which has a GetObject method.
XmlDocument xdoc = new XmlDocument();
StringWriter sw = new StringWriter();
XslCompiledTransform xtfrm = new XslCompiledTransform();
xtfrm.Transform(xdoc, null, sw);
String sHTML = sw.ToString();
Then, I remove the namespace declarations from the stylesheet tag, that would cause problems:
sHTML = sHTML.Replace("xmlns:asp=\"remove\"", "");
sHTML = sHTML.Replace("xmlns:cc1=\"remove\"", "");
Then, I add in the “Register” tag necessary for the user control that contains the GoView.
sHTML = "<%@ Register Src=\"~/ctrlChartFlow.ascx\" TagName=\"FlowChart\" TagPrefix=\"cc1\" %>" + sHTML;
Then I continue on with the creation of the page content:
hldrItem.Controls.Clear(); //hldrItem is the PlaceHolder control for this page's content
StringWriter sw2 = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw2);
Control data = Page.ParseControl(sHTML); //here is where the user control's GoView creation code is called.
I hope someone finds this information useful. I think this is a really powerful way to have template-based functionality that can use the (wonderful) GoView diagrams within the pages.