>> Questions about Flow: XML -> Send to Friend

G

Gene Ellis

Hey everyone,

I have a simple task. I want to take an XML file, pull out the
elements in it, format them, and then send an html email based on it.
What are the necessary steps? Any suggestions? I know how to write XSL
style sheets. Most of my confusion lays in how to get the XML elements
for matted and the transformed in such a form that is email-able.
Thank you so much!
 
A

Andrzej Adam Filip

Gene said:
Hey everyone,

I have a simple task. I want to take an XML file, pull out the
elements in it, format them, and then send an html email based on it.
What are the necessary steps? Any suggestions? I know how to write XSL
style sheets. Most of my confusion lays in how to get the XML elements
for matted and the transformed in such a form that is email-able.
Thank you so much!

If you use unix/linux:
* Use xslt to convert the xml file to "hmtl file" (xml -> html) and "email
headers file" (xml -> plain text). You can use two xsl files or xslt processor
capable to produce more than one output file.
* Use the command below to send the files
( cat msg.hdr; echo ; cat msg.html) | sendmail -oi -t

-t - will make sendmail (or MTA pretending to be sendmail) to get recipient
addresses from headers

Recomended headers in msg.hdr:
subject,from,to (OR cc OR bcc),
Content-Type (text/html),Content-Transfer-Encoding (8bit),MIME-Version (1.0).

--
Andrzej [en:Andrew] Adam Filip (e-mail address removed) (e-mail address removed)
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
English is an obsolete name. We speak usanesse.
-- 2004
 
M

Malcolm Dew-Jones

Gene Ellis ([email protected]) wrote:
: Hey everyone,

: I have a simple task. I want to take an XML file, pull out the
: elements in it, format them, and then send an html email based on it.
: What are the necessary steps? Any suggestions? I know how to write XSL
: style sheets. Most of my confusion lays in how to get the XML elements
: for matted and the transformed in such a form that is email-able.
: Thank you so much!

This is a two step job.

First step is to create the text/plain and-or text/html sections. Ignore
all issues of mail formatting at this stage. This is a standard xml/xsl
process. Create the data as xml. Use xlst to pull out the things you
want and format them the way they should eventually be seen. Save the
result in one or more files (one file per format, e.g. if the mail should
have a text/plain section and a text/html section then format then there
will be two files produced).


Second step is to pack the files into a mail message. You could probably
use a stylesheet for that, but why bother? Use a mail or mime tool to
bundle the parts together. I have used perl MIME::Lite, but there are
numerous other tools available.
 
G

GIMME

What operating system are you on and what tools are you wanting to use?

Why can't you do a transform and send a message formated in html (xhtml)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top