I apologize for not giving enough information , Below is the C# Code , XML document , XSL Argument value and the output of XSL Transformation in VS 2003 and VS 2005 , If you closely look at the XSL output in 2003 , there is a label called "CONTENTPANE " but this is not rendered in VS 2005.
Thanks
Ganesh
XML -------
<VIEWERPROPS><CAT ID= "appearanceProps " TEXT= "General Appearance "><PROP TEXT= "Allow Resize " ID= "AllowResize " TYPE= "Combo " ADMIN= "1
" DEFAULT= "1 " VALUE= "1 "><VALUES><ADD TEXT= "Yes " VALUE= "1 "></ADD><ADD TEXT= "No " VALUE= "0 "></ADD></VALUES></PROP><PROP TEXT= "Allow
Remove " ID= "AllowRemove " TYPE= "Combo " ADMIN= "1 " DEFAULT= "1 " VALUE= "1 "><VALUES><ADD TEXT= "Yes " VALUE= "1 "></ADD><ADD TEXT= "No "
VALUE= "0 "></ADD></VALUES></PROP><PROP TEXT= "Default Height " ID= "Height " TYPE= "text " ADMIN= "0 " DEFAULT= "100 " VALUE= "500
"></PROP><PROP TEXT= "Default Width " ID= "Width " TYPE= "text " ADMIN= "0 " DEFAULT= "100 " VALUE= "975 "></PROP><PROP TEXT= "Show
Scrollbars " ID= "ShowScrollbars " TYPE= "Combo " ADMIN= "0 " DEFAULT= "0 " VALUE= "0 "><VALUES><ADD TEXT= "Yes " VALUE= "1 "></ADD><ADD
TEXT= "No " VALUE= "0 "></ADD></VALUES></PROP></CAT><CAT ID= "borderProps " TEXT= "Border Settings "><PROP TEXT= "Show Border " ID=
"ShowAttribute " TYPE= "Combo " ADMIN= "0 " DEFAULT= "1 " VALUE= "0 "><VALUES><ADD TEXT= "Yes " VALUE= "1 "></ADD><ADD TEXT= "No " VALUE= "0
"></ADD></VALUES></PROP><PROP TEXT= "Width " ID= "BorderWidth " TYPE= "text " ADMIN= "0 " DEFAULT= "100 " VALUE= "1 "></PROP><PROP TEXT=
"Color " ID= "BorderColor " TYPE= "text " ADMIN= "0 " DEFAULT= "#999966 " VALUE= "#999966 "></PROP></CAT><CAT ID= "titleProps " TEXT= "Title
Bar Settings "><PROP TEXT= "Visible " ID= "ShowTitle " TYPE= "Combo " ADMIN= "0 " DEFAULT= "1 " VALUE= "0 "><VALUES><ADD TEXT= "Yes " VALUE=
"1 "></ADD><ADD TEXT= "No " VALUE= "0 "></ADD></VALUES></PROP><PROP TEXT= "Title " ID= "Title " TYPE= "text " ADMIN= "1 " DEFAULT= "Portlet
Title " VALUE= "My Title "></PROP><PROP TEXT= "Background Color " ID= "TitleBGColor " TYPE= "text " ADMIN= "1 " DEFAULT= "#f7f7c6 " VALUE=
"#f7f7c6 "></PROP><PROP TEXT= "Font Type " ID= "TitleFontType " TYPE= "text " ADMIN= "1 " DEFAULT= "verdana " VALUE= "Arial "></PROP><PROP
TEXT= "Font Color " ID= "FontColor " TYPE= "text " ADMIN= "1 " DEFAULT= "black " VALUE= "black "></PROP></CAT><CAT ID= "DATASOURCE "><CAT ID=
"CustomControlProps " TEXT= "Custom Control Properties "><PROP TEXT= "Assembly Name " ID= "AssemblyName " TYPE= "text " ADMIN= "1 " DEFAULT=
"SIBCUSTOMCONTROLS.dll " VALUE= "SIBCUSTOMCONTROLS.dll "></PROP><PROP TEXT= "Class Name " ID= "ClassName " TYPE= "text " ADMIN= "1 " DEFAULT=
"SIB.INFOBASE.WEB.CustomControls.Login " VALUE= "SIB.INFOBASE.WEB.CustomControls.Login "></PROP></CAT></CAT></VIEWERPROPS>
XSL Arguments Value --------------
CurrentState = 3
AllowPersonalization = False
WebPartType = "CustomControl"
IsAdmin = False
IsSharedView = False
ShowHelp = False
IsUserWebPart = False
C# Code ----------------------------------------------------------------------------------------------------
using nsSysXml = System.Xml; using nsSysIO = System.IO;
protected string Transform(string XSLString, string XMLString, nsSysXml.Xsl.XsltArgumentList XSLArguments) { //Load the XML and XSL in memory streams. nsSysIO.StringReader objXmlReader = new nsSysIO.StringReader(XMLString); nsSysIO.StringReader objXslReader = new nsSysIO.StringReader(XSLString);
nsSysXml.XPath.XPathDocument xdXmlDoc; nsSysXml.XPath.XPathDocument xdXslDoc; nsSysXml.Xsl.XslTransform xtTransform = new nsSysXml.Xsl.XslTransform();
//Create the output stream for Transformed XML. nsSysIO.StringWriter objOutXml = new nsSysIO.StringWriter();
try { //Create the XMLDocument object for XML and XSL. xdXmlDoc = new nsSysXml.XPath.XPathDocument(objXmlReader); xdXslDoc = new nsSysXml.XPath.XPathDocument(objXslReader);
xtTransform.Load(xdXslDoc, null, null);
//Transform the XML. xtTransform.Transform(xdXmlDoc, XSLArguments, objOutXml, null);
return objOutXml.ToString(); } finally { //Close all the open streams. if (objXmlReader != null) { objXmlReader.Close(); }
if (objXslReader != null) { objXslReader.Close(); }
if (objOutXml != null) { objOutXml.Close(); }
objXmlReader = null; objXslReader = null; xdXmlDoc = null; xdXslDoc = null; xtTransform = null; objOutXml = null; } }
--XSL Transformation Result in 2003 ----------------------------------------------
<DIV ID= "ViewerRoot " style= "padding-left:2px;padding-top:2px;padding-bottom:2px;padding-right:2px;display:block; " xmlns:asp= "remove "> <script>
function showControlMenu(e, MenuImageID) { var objMenuTable; var posX = 0; var posY = 0; var sMenuID; //Code to get the proper mouse coordinates based upon the browser. if(window.event) { posX = window.event.x + window.document.body.scrollLeft - 200; posY = window.event.y + window.document.body.scrollTop;
} else { posX = e.pageX - 200; posY = e.pageY; } sMenuID = MenuImageID.substring(0,MenuImageID.indexOf('PullMenu')); objMenuTable = window.document.getElementById(sMenuID + 'CONTROLMENUTABLE'); if(objMenuTable) { objMenuTable.style.left = posX; objMenuTable.style.top = posY; objMenuTable.style.display = 'inline'; setTimeout( "hideControlMenu(' " + objMenuTable.id + "') ", 5000); } }
function hideControlMenu(sMenuTable) { var objMenuTable; objMenuTable = window.document.getElementById(sMenuTable); if(objMenuTable) { objMenuTable.style.display = 'none'; } }
function highlightMe(MenuItem) { MenuItem.style.background = 'white';
}
function doPostBack(ControlName) { __doPostBack(ControlName, ''); }
</script>
<TABLE cellspacing= "0 " cellpadding= "0 " border= "0 " style= " height:500px; width:975px; "> <TR ID= "CONTENTROW " valign= "top "> <TD colspan= "2 " style= " width:975px; height:485px; "> <asp:label ID= "CONTENTPANE" runat= "server " style= " width:975px; height:485px; ">
</asp:label> </TD> </TR> </TABLE>
<DIV ID= "CONTROLMENUTABLE " style= "display:none;position:absolute;left:0px;top:0px; " runat= "server " width= "200px "> <TABLE border= "0 " cellpadding= "0 " cellspacing= "0 " width= "200px " style= " font-family: Tahoma, Verdana, Arial, Helvetica,
sans-serif; font-size: 8pt; font-weight: normal; background-color: #f7f7c6; vertical-align:middle; height:25px;
border-color:black; border-top:white 1px solid; border-bottom:black 1px solid; border-left:white 1px solid;
border-right:black 1px solid; "> </TABLE> </DIV> </DIV>
XSL Transformation Result in 2005 ------------------------------------------------
<DIV ID="ViewerRoot" style="padding-left:2px;padding-top:2px;padding-bottom:2px;padding-right:2px;display:block;" xmlns:asp="remove"> <script> function showControlMenu(e, MenuImageID) { var objMenuTable; var posX = 0; var posY = 0; var sMenuID; //Code to get the proper mouse coordinates based upon the browser. if(window.event) { posX = window.event.x + window.document.body.scrollLeft - 200; posY = window.event.y + window.document.body.scrollTop; } else { posX = e.pageX - 200; posY = e.pageY; } sMenuID = MenuImageID.substring(0,MenuImageID.indexOf('PullMenu')); objMenuTable = window.document.getElementById(sMenuID + 'CONTROLMENUTABLE'); if(objMenuTable) { objMenuTable.style.left = posX; objMenuTable.style.top = posY; objMenuTable.style.display = 'inline'; setTimeout("hideControlMenu('" + objMenuTable.id + "')", 5000); } } function hideControlMenu(sMenuTable) { var objMenuTable; objMenuTable = window.document.getElementById(sMenuTable); if(objMenuTable) { objMenuTable.style.display = 'none'; } } function highlightMe(MenuItem) { MenuItem.style.background = 'white'; } function doPostBack(ControlName) { __doPostBack(ControlName, ''); } </script>
<TABLE cellspacing="0" cellpadding="0" border="0" style=" width:975px; "> </TABLE> <DIV ID="CONTROLMENUTABLE" style="display:none;position:absolute;left:0px;top:0px;" runat="server" width="200px"> <TABLE border="0" cellpadding="0" cellspacing="0" width="200px" style=" font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; background-color: #f7f7c6; vertical-align:middle; height:25px; border-color:black; border-top:white 1px solid; border-bottom:black 1px solid; border-left:white 1px solid; border-right:black 1px solid; "> </TABLE> </DIV> </DIV>
|