User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 423,540 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,235 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 3991 | Replies: 85 | Solved
Reply
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #51  
Feb 7th, 2008
Right, I have now got the XSLT to transform the XML to HTML. I am also able to store this new HTML file to a directory, (not specifiable by user...yet).It was as I said, I had saved the file but not writetn the newly created HTML to it!Great! now I have to concentrate on geting the newly created HTML file to have the extension .html not .xml. This I will investigate!
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Sep 2007
Posts: 1,057
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #52  
Feb 7th, 2008
you just save it with .html instead of .xml. Okay, this is what you need to do.

1. Save the file
2. Open/Apply the XSLT to the .xml file
3. Save the file AS filename.html
4. Create download link to file location.
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #53  
Feb 7th, 2008
ok thanks, just getting on to the extension renaming part now.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #54  
Feb 7th, 2008
I had thought it was as simple as

fileName.ReplaceExtension(".html");

But I was wrong lol!
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Sep 2007
Posts: 1,057
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #55  
Feb 7th, 2008
no no lol, you need to use "saveAs" and save it with the name and the extension .html. Do something like, find the period in the string with InStr, then get the left number characters from that dot (InStr - 1), then "SaveAs(filename & ".html")"
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #56  
Feb 7th, 2008
right ok. that does sound difficult, I know nothing about InStr for starters lol
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #57  
Feb 7th, 2008
what would be ideal is if the user is forced to just save the file in a hard coded directory (created if not existing) as html file. Now I have achieved half of that goal! the html is saved to (say c:/temp) hard coded dir but its saved as .xml not .html.all i want is to change the file extension before it is saved in c:/temp. Any ideas? THanks
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Sep 2007
Posts: 1,057
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #58  
Feb 7th, 2008
You can. Right where you have "saveAs" you are saving it.

InStr is just In String. It finds the first position of a character or phrase.

So lets say the filename is:
Dim filename As String = "yucky.xml"

You use InStr to find it:
InStr(filename, ".xml")

Or use a huge one and just do everything at once:

.SaveAs((filename.remove((InStr(filename, ".xml")),(Len(filename)-(InStr(filename,".xml"))))) & ".html")
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #59  
Feb 7th, 2008
ok man, thanks for all your help with this you are a star!
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: Last q on this project I promise lol

  #60  
Feb 7th, 2008
hey I am using c#, whats the equivalent for InStr in c#
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 5:40 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC