W3C home > Mailing lists > Public > www-forms@w3.org > August 2010

Re: data export for subsequent transformation to csv

From: e-letter <inpost@gmail.com>
Date: Fri, 13 Aug 2010 10:07:20 +0100
Message-ID: <AANLkTi=ndBFgy=PvZJawanc2qR9TjH1aBJK+m_hbc+0L@mail.gmail.com>
To: Leigh L Klotz Jr <leigh.klotz@xerox.com>
Cc: www-forms@w3.org
On 12/08/2010, Leigh L Klotz Jr <leigh.klotz@xerox.com> wrote:
>I hope this message reaches you as your email address doesn't seem accurate, but perhaps you'll see it on the list.
I looked at the mail archive but could not see any messages for this month?

>There are a couple of issues with your form:
>1. The instance should start out with elements for all the elements you want in the result.  In general, XForms form controls only change the text values of elements and attributes, and don't add them.  (There are a few cases where they do get added by controls and actions, but in the case of your form, they don't.)
Referring to the w3 document 'xforms11', an example model element is produced:

    <ecommerce xmlns="">
  <xforms:submission action="http://example.com/submit" method="post"
id="submit" includenamespaceprefixes=""/>

and applied to an html document:

<select1 ref="method">
  <label>Select Payment Method:</label>

I concluded from this example that if I create an element 'testform'
with a namespace 'generalinformation', the element 'select1' with
attribute 'ref='generalinformation'' could be applied. This did not
work so I removed the attribute 'ref'.

>2. The use of namespaces in the instance isn't quite right.   You might want to read up on an XML book on the topic, or just take a look at what I've done and generalize.
>3. Each form control needs a "ref" attribute with the path to the element in the instance where you want the data placed.   I've put some in that work, but you can of course change the instance data around.  If you need to move the elements down a level inside other elements, you'll need to use the XPath syntax "a/b/c" to get to element "c" inside "b" inside "a".  In XForms, you get the toplevel element name for free.
>That ought to be make it work.  Here's the output I got once I made those changes:
>Here's the updated form, and below that are some enhancements you might consider:
><?xml version="1.0" encoding="UTF-8"?>
><html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms">
>  <head>
>    <style type="text/css">
>      code {text-color:black; background:white; font-family:verdana, sans-serif}
>    </style>
>    <xf:model>
>      <xf:instance>
>        <generalinformation xmlns="">
>          <purpose />
>          <weatherLocation />
>        </generalinformation>
>      </xf:instance>
>      <xf:submission resource='file:testgeneral.xml' method="put" id="gi" />
>    </xf:model>
>    <title>
>      test xml to csv for postgresql
>    </title>
>  </head>
>  <body>
>    <p>
>      <xf:select1 ref="purpose" appearance='minimal'>

The addition of the attribute 'ref' causes the list menu to disappear
(tested in firefox version 2009, 304, 36rc2 and now using 368, all
with suitable versions of the xforms plugin). All that appears is the
button icon labelled 'send'. When I remove the attribute 'ref', the
list menu reappears.

Received on Friday, 13 August 2010 09:07:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:23 UTC