Erik,

        That was my first thought but when I do the following, I lose all
of the html formatting.

        <p:processor name="oxf:xslt">
                <p:input name="data" href="#instance"/>
                <p:input name="config">
                        <html xmlns="http://www.w3.org/1999/xhtml";
xsl:version="2.0">
                                <body>
                                        <div>Admin,<br/>
                                                <br/>
                                        </div>
                                        <div>
                                                <xsl:copy-of
select="form/user/profile/firstName"/>&#160;<xsl:copy-of
select="form/user/profile/lastName"/> would like to register.<br/>
                                                <br/>
                                        </div>
                                        <div>The Orbeon servlet
engine</div>
                                </body>
                        </html>
                </p:input>
                <p:output name="data" id="message-part"/>
        </p:processor>

        <p:processor name="oxf:email">
                <p:input name="xforms-instance"
href="#text-xforms-instance"/>
                <p:input name="my-msg" href="#message-part"/>
                <p:input name="data">
                        <message>
                                ...
                                <body mime-multipart="mixed">
                                        <part name="part1"
content-type="text/html" content-disposition="inline" src="oxf:my-msg"/>
                                        <part name="xforms"
content-type="text/xml" content-disposition="attachment;
filename=&quot;instance.xml&quot;" src="oxf:xforms-instance"/>
                                ...

        Yields an email message that looks like (in an html enabled email
client):

Admin,John Doe would like to register.The Orbeon servlet engine

No html tags at all when I do a view source.

Additionally, I can't see how to use the XSLT to generate the <to> fields
of the e-mail.  Any suggestions?  I tried generating the entire message in
XSLT, as I originally had it, but the XSLT processor complained that it
could not find the xforms-instance.  Looking at the documentation I just
figured it was because the XSL processor only understands input by the
name data or config.  Am I wrong about this?

The original message had no issues at all with the html but as I said it
simply would not recognize the xml attachment part.  This is what I had
originally:

        <p:processor name="oxf:xslt">
                <p:input name="xforms-instance"
href="#text-xforms-instance"/>
                <p:input name="data" href="#file"/>
                <p:input name="config">
                        <message xsl:version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
                                <smtp-host>localhost</smtp-host>
                                <from>
                                        <email>[EMAIL PROTECTED]</email>
                                        <name>Servlet</name>
                                </from>
                                <xsl:if test="/form/user/profile/email !=
'' ">
                                        <to>
                                                <email>
                                                        <xsl:value-of
select="/form/user/profile/email"/>
                                                </email>
                                                <name>
                                                        <xsl:value-of
select="form/user/profile/firstName"/>&#160;<xsl:value-of
select="form/user/profile/lastName"/>
                                                </name>
                                        </to>
                                </xsl:if>
                                <to>
                                        <email>[EMAIL PROTECTED]</email>
                                        <name>Administrator</name>
                                </to>
                                <subject>Orbeon test e-mail messages (from
the servlet)</subject>
                                <body mime-multipart="mixed">
                                        <part name="part1"
content-type="text/html">
                                                <html>
                                                        <body>
        
<div>Admin,<br/>
        
<br/>
                                                                </div>
                                                                <div>
        
<xsl:copy-of select="form/user/profile/firstName"/>&#160;
        
<xsl:copy-of select="form/user/profile/lastName"/> would like to
register.<br/>
        
<br/>
                                                                </div>
                                                                <div>The
Orbeon servlet engine</div>
                                                        </body>
                                                </html>
                                        </part>
                                        <part name="xforms"
content-type="text/xml" content-disposition="attachment;
filename=&quot;instance.xml&quot;" src="oxf: xforms-instance"/>
                                </body>
                        </message>
                </p:input>
                <p:output name="data" id="message"/>
        </p:processor>
        <p:processor name="oxf:email">
                <p:input name="data" href="#message"/>
        </p:processor>

On a separate issue, I am trying to consume a MS NET webservice at
http://services.xmethods.net that has no namespace defined for the input
SOAP body (your example uses an Apache SOAP format on the same site).
When I attempt to use it without a nsuri I get

Fatal Error: URI=null Line=3: The value of the attribute
"prefix="xmlns",localpart="m",rawname="xmlns:m"" is invalid. Prefixed
namespace bindings may not be empty.

I am sure this is just due to my lack of experience with webservices but
if you could offer a pointer or two on this I would appreciate it.

Greg


Date: Mon, 15 Nov 2004 21:48:41 +0100
From: Erik Bruchez <[EMAIL PROTECTED]>
Organization: Orbeon, Inc.
To: [EMAIL PROTECTED]
Subject: Re: [orbeon-user] Re: Re: email processor
Reply-To: [EMAIL PROTECTED]

In that case, build the body of the message with XSLT, and extract the
elements from the instance that you want to show. For example in an HTML
message:

<p>
   This is the first name: <xsl:value-of select="/form/first-name"/>.
</p>

Is that the kind of thing you are trying to achieve?

-Erik

Gregory Blajian wrote:
> Erik,
> 
>       Using your example (below) how do I reference data (individual
> elements) in the instance or text-xforms-instance?  Or is that not 
> possible under this scheme?  I definitely want the entire attachment 
> but I want the message to indicate one or two elements from the 
> instance data in html or plain text for the recipient to read without 
> opening the attachment.  And as an unrelated question, if I am 
> receiving the user group responses in digest form is there anyway to 
> reply to a post so that it stays in the thread?
> 
> Greg
> 
> 
> Your example:
> 
> <!-- Convert the XForms instance into text --> <p:processor 
> name="oxf:xml-converter">
>      <p:input name="data" href="#instance"/>
>      <p:input name="config"><config/></p:input>
>      <p:output name="data" id="text-xforms-instance"/> </p:processor>
> 
> <!-- Send email -->
> <p:processor name="oxf:email">
>      <p:input name="data">
>          ...
>          <body mime-multipart="mixed">
>              ...
>              <part name="xforms" content-type="application/xml"
>                content-disposition="inline; 
> filename=&quot;instance.xml&quot;"
>                src="oxf:xforms-instance"/>
>          </body>
>         ...
>      </p:input>
>      <p:input name="xforms-instance" href="#text-xforms-instance"/> 
> </p:processor>



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to