XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 6th, 2003, 01:09 AM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
Wink XML to Word transformation

Hi All

I have an XML file which gets transformed into HTML via an XSL stylesheet. The HTML file is in a tabular format. this is all good.

What I want to do is perform a similar transformation of the xml file but have it directly output to MS word - any ideas on the best way to do this?

tia

Reply With Quote
  #2  
Old July 6th, 2003, 06:55 AM
Wizard2003's Avatar
Wizard2003 Wizard2003 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 206 Wizard2003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 29 m 24 sec
Reputation Power: 6
I do now how to transform XML into Word format because a Word document has a proprietary format.
What about opening the html file in Word and save it as doc?

Reply With Quote
  #3  
Old July 6th, 2003, 05:12 PM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
what i'm using is the VB DOM to open and transform the xml file (using XSL) , the result is saved in an HTML format. I then use VB word application objects to open the html file in a word session, however when i do this all i get is the HTML source not the 'pretty' stuff.
The reason I need to be able to open the formatted html in word is so i can muck around with page breaks for printing purposes.
if i open the html file in an internet explorer session it all looks great

not sure what I'm doing wrong....

Reply With Quote
  #4  
Old July 7th, 2003, 11:48 AM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
Hey - I have been trying to figure out how to save my HTML to a file with .html extension and not just render it to the browser upon request. My XSl is transforming the entire site properly but I have not found a way to "save a copy" of the resulting html that is rendered. Do you mind showing me what you are talking about in the VB Dom transformation?

Reply With Quote
  #5  
Old July 7th, 2003, 12:18 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Well, if you have some time and feel like learning java, you can use Cocoon: http://cocoon.apache.org/2.0/ to do the conversion. It has an output stream for Word (and I think Excel) documents.

Reply With Quote
  #6  
Old July 7th, 2003, 05:00 PM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
thanks for that - looks like I now have a choice of the lesser of a few evils as I did manage to find an offical Word Markup Language reference (attached) - on a quick glance it looks fairly extensive and Java still might be the go.

I also came a cross a number of sites which also might be of interest to anyone else going along the XML -> word route

http://www.xmlsoftware.com - has lots of XML related conversion tools XML2RTF, DB2XML, OniMark, ASP2XML etc

http://www.scriptura-xsl.com/index.html - these guys have a product which uses XSL-FO to produce reports in multiple formats
- means learning XSL-FO and WordML tho


Attached Files
File Type: zip ofhtml9.zip (626.2 KB, 581 views)

Reply With Quote
  #7  
Old February 23rd, 2004, 05:56 PM
adimago adimago is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 adimago User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It's quite easy...

//Saving the File...
fso = new ActiveXObject ("Scripting.FileSystemObject");
strFilePath = "C:\\Document.html"
ts = fso.CreateTextFile (strFilePath, true, true);
ts.Write(tmp);
ts.Close();

//Opening it in Word...
word = new ActiveXObject("word.application");
word.Visible = true;
word.Documents.Open("C:\\Document.html");

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XML to Word transformation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT