Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 3rd, 2003, 01:32 PM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default XLST vs Sever Controls

Is anyone else out there as frustrated as I am regarding the conflict between XLST and Server Controls.

What I mean is you can mix xslt output side by side with server controls but you cannot wrap xslt around the server controls. E.g. you would get an error if you put <asp:TextBox id="TextBox1" runat="server"></asp:TextBox> within an xslt file.

For me one of the biggest advantages of xslt is controlling how each page is laid out in one .xsl file, allowing me to standardize the look and feel across an entire web site. If I want to put server controls in the middle of this its just not possible. Therefore I have found myself using html controls inside the xslt but then I lose the benefits of rapid development with server controls.

If only the server controls could be rendered on the server after the xsl is transformed the problem would be solved.

If anyone else has an opinion in this area, or has figured out a work around I would be very interested to know.

Regards

Andy
__________________
Skin
 
Old July 4th, 2003, 04:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I don't know what server controls are, but why should you get an error placing <asp:TextBox id="TextBox1" runat="server"></asp:TextBox> inside xslt? Unless you haven't declared the asp namespace of course...
 
Old July 4th, 2003, 12:27 PM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pgtips
 I don't know what server controls are, but why should you get an error placing <asp:TextBox id="TextBox1" runat="server"></asp:TextBox> inside xslt? Unless you haven't declared the asp namespace of course...
A server control is a control which asp.net renders into html. It provides an easy interface on the server end to interact with the control.

As you rightly said you get an error because asp is not a recognized namespace. But that's just it, I don't want to declare the namespace as it will then be output in the html as the following, which means nothing:
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>

Instead I want asp.net to recognize it as a server control and render it as html, but unfortunately it doesn't work like that.

Skin
 
Old July 11th, 2003, 01:29 PM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To get the rendering of server controls, you have to have your page compiled. That means your XSL is going to generate a file that you'll save on your server, and then execute as if you had hand coded it.

So basically, your XSL will just allow to write those files out faster. Server controls need to be run on the server.

The flow will look something like this:
XML + XSL -> page.aspx -> save to disk -> visit page.aspx

You might have to add the processing directive atop the page in your output to get your page compiled properly.

Good luck,
Mike





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Sever pushpa All Other Wrox Books 0 February 22nd, 2007 07:01 AM
how to use pagination in xsl or xlst vijayanmsc XSLT 1 June 6th, 2006 06:07 AM
XLST Multiple Foreach deepsweech XSLT 3 June 20th, 2005 09:46 AM
XLST transformNode problem beyondtron Classic ASP XML 0 February 4th, 2004 04:52 PM
Sever has not yet been opened ravee789 Crystal Reports 2 October 20th, 2003 06:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.