Last q on this project I promise lol
Hi there. The project I am building is an ASP.NET browser based application that has two classes.
Login class
main menu class
now these two classes are working as they should (I.e. valid user logs in, proceed to main menu). The trouble is, I also have another class that applies an XSLT to a user specified (Via main menu) XMLfile. the user navigates to an XML file (on hard disk) then specifies an output directory (browsing again) to store the output. there is a submit button the user hits when they are ready to transorm the XML. the trouble I am having is that i do not know how to transmit the data from the two browsers (XML File locator and output file locator) to the XSLT class. i.e. I do not know how to specify to my transformer class which XML is to be used.
Any suggestions?
thanks for your time!
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
forgot to add, I am using C# for scripting/transform class.
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
Right, an update. have managed to get the file upload to save a file (copy) specified by a user (via the browse button) to a directory (specified by the user via a textbox).Now this obviously only copies the file. what I need is to learn is how to apply the XSLT before the file is output. Any ideas folks? thanks
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
having thought about this, the file upload box will only COPY a file to a web server. it doesnt cater for CREATION of files. therefore, I will be able to apply an XSLT to an XML file I upload, but I will not be able to save the modified version. Is that correct ?
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
Now I am a bit confused... is the file saved on your server or on the clients' machines? If you are only redirecting the save, then you cannot apply the XSLT. But if you are saving it to your server, then you can apply it. A workaround for this is that first they upload the file to you, you save it in a temp directory on the server, apply the XSLT, then send it back to the client and delete your copy on the server.
Is that what you are trying to do?
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
that is essentially what I need to do yes, but I went down the wrong way with this.I initially thought I could save it to their machine and transform it before the save was established. Saving it in a temp dir, apply XSLT send to client. That is an excellent idea, I hadn't thought of that. I have been hell bent on getting it to work the other (wrong) way lol. I'll give it a bash and let you know how it goes SheSaidImaPregy.Thanks for your reply
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
Yeah no problem. The reason why you cannot do it the other way is that the only way you can modify a file is that if it gets to your server and you can modify it there. Otherwise, the client would have to have the XSLT file (I think its a file, or XSL) on their computer for you to apply it.
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
of course! that makes perfect sense now. thanks, I was thinking might there be security implications if a server could transform an uploaded file before it saves it back to your hard drive?
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
Yup, it is not allowed. Otherwise, it is called hacking and is illegal. Its fun, but not cool for the person being hacked! lol
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
ok so the plan is to upload file to server, write code to save file on server, perform transformation on that file on server then send transformed file (from server) back to client.Finally remove original xml file from server lol seems like a lot of work is there no easier way ?
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
also, how do I create a DOWNLOAD/SAVE AS dialog button so a user (client) can specify where they want to save file on hard drive ? Visual C# has a control for a file upload box but not a download box - which I think is odd
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
nope. no easier way. But matter of fact.. it is quite easy! You do a simple save, the open the file, rewrite it, then save it again.. then send it back and delete. Only hard part is the rewriting, but if you can do that then it is easy!
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
most people don't upload then download right away :)
so no there is no way to modify the upload button/box unless you deal with java that runs on the clients' platform.
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
ok thanks a lot for all your help with this, will knuckle down and let you know how it goes!
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
how would I get the XML file transformed server side, have been researching this and I cannot find much info about it. any ideas?
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
hi there SheSaidImaPregy, that tutorial you advised I look at is very helpful but it deals mainly with databases and aspnet. I am not using a database system in this project, I just need the user to be able to specify an xml file to upload to server, server XSLT that xml to produce HTML (I have written the XSLT). The user can then download this HTML file to their local hard drive. All this needs to be done via a web browser (ASP.net).THis project is tough but I am not going to give up on it!Thanks again for all your help
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72