Greg,

I see that your base dir is:

/opt/tomcat/webapps/orbeon/WEB-INF/resources/selfreg/uploads

This means you must be writing a file of the form:

/opt/tomcat/webapps/orbeon/WEB-INF/resources/selfreg/uploads/XForms_data_xxx.xml

But you read it with:

oxf:/uploads/XForms_data_xxx.xml

I think you are missing "selfreg" somewhere...

BTW, since you are saving a file on disk, you should read it back with
the file: protocol rather than using the oxf: protcol.

A little XSLT tip. Instead of writing:

<xsl:variable name="myDate">
  <xsl:value-of select="current-dateTime()"/>
</xsl:variable>

You can write:

<xsl:variable name="myDate" select="current-dateTime()"/>

Now this is good, but your example still won't work, because you are
copying the text nodes only of your XML file with:

<xsl:copy-of select="/*/text()"/>

What you really want to do is actually convert your XForms instance to
a text XML document and attach it to your email, right?

With the current CVS, you can do something like this:

<!-- 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>


-Erik

Gregory Blajian wrote:
> Erik,
>
> I am using your example <
> http://sourceforge.net/mailarchive/forum.php?thread_id=5802986&forum_id=42
> 083 > to try to attach an xml document (originally instance data) to an
> e-mail. But I keep getting
>
> Cannot read from file /uploads/XForms_data_2004-11-12T10_28_56.183-05_00.x
> ml
>
> I tried absolute path and relative path but neither allows me to read from
> the file. The file is on the disk when I look but I am not sure the file
> is written and closed prior to trying to read it. Any ideas? Here is my
> xpl:
>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#instance"/>
> <p:input name="config">
> <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> <xsl:variable name="nocache1"
> select="''"/>
> <xsl:variable name="nocache2"
> select="document($nocache1)"/>
> <xsl:variable name="myDate">
> <xsl:value-of
> select="current-dateTime()"/>
> </xsl:variable>
> <file>XForms_data_<xsl:value-of
> select="translate($myDate,':','_')"/>.xml</file>
>
> <directory>/opt/tomcat/webapps/orbeon/WEB-INF/resources/selfreg/uploads</d
> irectory>
> </config>
> </p:input>
> <p:output name="data" id="myfile"/>
> </p:processor>
> <p:processor name="oxf:file-serializer">
> <p:input name="config" href="#myfile"/>
> <p:input name="data" href="#instance"/>
> </p:processor>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#myfile"/>
> <p:input name="config">
> <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> <url>oxf:/uploads/<xsl:value-of
> select="/config/file"/>
> </url>
> <content-type>text/xml</content-type>
> </config>
> </p:input>
> <p:output name="data" id="myfile2"/>
> </p:processor>
> <p:processor name="oxf:url-generator">
> <p:input name="config" href="#myfile2"/>
> <p:output name="data" id="file" debug="file"/>
> </p:processor>
> <p:processor name="oxf:xslt">
> <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>John Doe</name>
> </from>
> <to>
> <email>[EMAIL PROTECTED]</email>
> <name>Bob Smith</name>
> </to>
> <subject>Orbeon test e-mail messages (from
> the servlet)</subject>
> <body>
> <part name="part1"
> content-type="text/plain">
>
> <xsl:text>Hello!</xsl:text>
> </part>
> <part name="part2"
> content-type="text/xml">
> <!--#data-->
> <xsl:copy-of
> select="/*/text()"/>
> </part>
> </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>
>
> TIA,
> Greg




-------------------------------------------------------
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