Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 12th, 2008, 09:30 AM
Friend of Wrox
Points: 660, Level: 9
Points: 660, Level: 9 Points: 660, Level: 9 Points: 660, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: St. Louis, , .
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default XML + XSL = HTML 4 EMAIL ??

XML can do a very cool trick.

If you include the name of an XSL file in the XML file, you can produce what looks just like a formatted HTML file when you load the XML file into a browser.

The question I have is this. How would you actually produce an actual HTML file that can be sent as a formated email by using this XML and XSL combo?

Let me put it another way.

First of all, consider this. Email has the capacity to send HTML formated text.

Second of all, consider this. XML along with a stated XSL style sheet can be loaded into a browser to produce an HTML document (right?).

So can the same be said for an email message? If email is sophisticated to send and html file properly formatted and presented as if it was being viewed in a browser, can it also to the same with an xml file?

I imagine not. I would imagine that it could not pull off this trick. I imagine that the first order of business would be to use the xml and xsl files to produce the html file and then use that generated html file as the email.

So what code or tools can be used to produce this html file?
Reply With Quote
  #2 (permalink)  
Old December 12th, 2008, 11:33 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Well a quick test should find out whether an email client supports XML with an added xsl-stylesheet processing instruction. The trouble is you have to test dozens to know if it was reliable.
I'd go with the second option. Transform the XML using your favourite XSLT processor, Saxon, .NET etc. and send the resulting HTML as the email.
__________________
Joe
http://joe.fawcett.name/
Reply With Quote
  #3 (permalink)  
Old December 15th, 2008, 08:50 PM
Friend of Wrox
Points: 660, Level: 9
Points: 660, Level: 9 Points: 660, Level: 9 Points: 660, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: St. Louis, , .
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by joefawcett View Post
Well a quick test should find out whether an email client supports XML with an added xsl-stylesheet processing instruction. The trouble is you have to test dozens to know if it was reliable.
I'd go with the second option. Transform the XML using your favourite XSLT processor, Saxon, .NET etc. and send the resulting HTML as the email.
Here is a follow-up question.
Let's look at the issue backwards going the other direction. Does there exist a tool or a 3rd party program that can take an HTML file and split it up into an XML and XSL file that will effectively display the same thing in a browser than the original HTML file?
Once I have decided how I want the HTML file to look, is there some sort of tool that will split an HTML document into an XML and XSL file that will display in a browser the same way as the HTML will?
I imagine that it might be a built-in feature for dreamweaver or some other web authoring tool. It shoule be, I think.
We masters must want to do this sort of thing from time to time.
Reply With Quote
  #4 (permalink)  
Old December 16th, 2008, 09:48 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>Let's look at the issue backwards going the other direction. Does there exist a tool or a 3rd party program that can take an HTML file and split it up into an XML and XSL file that will effectively display the same thing in a browser than the original HTML file?

That's a bit like asking whether you can take the number 4 and split into two numbers i and j such that i+j=4. Well yes you can: the trivial solutions are 4+0 or 0+4. And similarly, you could either put all the HTML in the XML document and have an identity stylesheet; or you could have an empty XML document and put all the data in the stylesheet. If you want an "intelligent" split then you would have to know which part of the HTML is fixed and which is variable; that would only start to become possible if you were looking at a collection of HTML pages that had some parts in common and some differences. (That might be a nice tool to have....)
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML code from XML to display using XSL koenige XSLT 6 October 27th, 2008 08:11 AM
line number in xml using xsl and html link mrame XSLT 3 June 17th, 2008 01:36 PM
Rendering HTML inside XML through XSL - HELP !!! jilly XSLT 6 May 23rd, 2007 10:36 AM
xml to html with xsl boblavinsky XSLT 4 January 5th, 2007 05:30 AM
XML/XSL to actual HTML tcstom XML 3 December 9th, 2005 01:36 PM



All times are GMT -4. The time now is 06:18 AM.


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