On 15.01.2005 14:28, lincoln wrote:

I have a form that once submitted will append data to the end of an XML
file. I also need to append the date and time that this data was added. eg:
<root>
  <data>
    <dateTime>Thur...</dateTime>
    <x>...</x>
    <y>...</y>
    <z>..</z>
  </data>
  <data>
    <dateTime>Fri...</dateTime>
    <x>...</x>
    <y>...</y>
    <z>..</z>
  </data>
  <data>
    <dateTime>Sat...</dateTime>
    <x>...</x>
    <y>...</y>
    <z>..</z>
  </data>
  ...
</root>

My code is based on the xml binding sample block and am trying to add this

I guess you mean CForms?

XSP code to get the date and time (works in isolation):
<xsp:page xmlns:xsp="http://apache.org/xsp";> <date><xsp:expr>new Date()</xsp:expr></date> </xsp:page>
I have heard you can generate a date in the sitemap.xmap somehow, is that
true and is it a better approach?


If I do use XSP then I can't see how this binds to the xml file, at a guess
I believe I would need to modify the sitemap somehow.

Don't use XSP at all. Add a fd:output with datatype date to your form definition, but not into the template. Immediately before saving the form set the value of the field to "new Packages.java.util.Date()".


Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to