Jump to content

ASP.NET-generated XSLT file


SirPaladin

Recommended Posts

Yes you can.No, the extension doesn't need to be .xslt. Infact, most XSLTs use .xsl extension but that's not requred either.I know that PHP grabs the raw content of the file (I don't know about ASP), so it's not even necessary to have a file. You can generate the XSLT inside the server script and run the XSLT processor at that point (before the XSLT reaches the client).

Link to comment
Share on other sites

Well, I`d had used ASP .NET because I find it cooler than PHP. >__>Well, perhaps you`d give me a more precise answer if I said my idea.So here`s the point. I want to define some XML tags, so using my tag set, i can query a database (or another XML file) and show the output. So basically, I want to try out my idea for a ColdFusion kinda project, but written in ASP.NET mostly.And for it to work, ideally, I`d have two files. The XML one, which I run, and the .aspx file my XML chooses as stylesheet. Seeing as XML takes the XSL file and uses it on the client, I guess it won`t find the ASP code, but its output, XML XSLT code.So will it work?

Link to comment
Share on other sites

Yes. It will work. As with most of the other similar stuff, the "type" attribute at the processing instruction makes the difference. So<?xml-stylesheet type="text/xsl" href="whatever"?>Will always attempt to read the file in the "href" attribute as an XSLT file and as you said, scince XSLT processing is done on the client in this case, the client actually gets the needed XSLT code instead of the server side script code.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...