Re: data export for subsequent transformation to csv

Your select1's aren't bound to any data nodes in the instance document. 
  So selecting a value in a select1 won't change the instance document. 
  Then you'll either have to pre-populate the instance document with the 
nodes that you want the select1 item selection to change or use a 
xf:insert action to build the instance document.

I hope that this helps get you on the right track,
--Aaron

e-letter wrote:
> Readers,
>
> I am trying to create a form to save data, for eventual import to a
> postgresql database. The following file was created:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
> xmlns:xf="http://www.w3.org/2002/xforms">
>  <head>
>   <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
>   <style type="text/css" id="internalstylesheet">
>    code {text-color:black; background:white; font-family:verdana, sans-serif}
>   </style>
>   <xf:model>
>    <xf:instance>
>     <xf:testform xmlns='generalinformation'>
>      <xf:generalinformation/>
>     </xf:testform>
>    </xf:instance>
>    <xf:submission
>     resource='file:testgeneral.xml'
>     method="put"
>     id="gi"
>     includenamespaceprefixes=""
>    />
>   </xf:model>
>   <title>
>   test xml to csv for postgresql
>   </title>
>  </head>
>  <body>
>   <p>
>    <xf:select1 appearance='minimal'>
>     <xf:label>purpose
>     </xf:label>
>     <xf:item>
>      <xf:label>
>       England
>      </xf:label>
>      <xf:value>
>       Building
>      </xf:value>
>     </xf:item>
>     <xf:item>
>      <xf:label>
>       Scotland
>      </xf:label>
>      <xf:value>
>       Building
>      </xf:value>
>     </xf:item>
>     <xf:item>
>      <xf:label>
>       Northern Ireland
>      </xf:label>
>      <xf:value>
>       Building
>      </xf:value>
>     </xf:item>
>     <xf:item>
>      <xf:label>
>       Energy England
>      </xf:label>
>      <xf:value>
>       joule
>      </xf:value>
>     </xf:item>
>     <xf:item>
>      <xf:label>
>       Energy Wales
>      </xf:label>
>      <xf:value>
>       joule
>      </xf:value>
>     </xf:item>
>     <xf:item>
>      <xf:label>
>       Energy Scotland
>      </xf:label>
>      <xf:value>
>       joule
>      </xf:value>
>     </xf:item>
>     <xf:item>
>      <xf:label>
>       Energy Northern Ireland
>      </xf:label>
>      <xf:value>
>       joule
>      </xf:value>
>     </xf:item>
>    </xf:select1>
>   </p>
>   <p>
>    <xf:select1 appearance='minimal'>
>     <xf:label>Weather location
>     </xf:label>
>     <xf:item>
>      <xf:label>
>       London
>      </xf:label>
>      <xf:value>London
>      </xf:value>
>     </xf:item>
>    </xf:select1>
>   </p>
>    <xf:submit submission='gi'>
>     <xf:label>
>      Send
>     </xf:label>
>    </xf:submit>
>  </body>
>  </html>
>
> The resultant xml file is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xf:testform xmlns:xf="http://www.w3.org/2002/xforms"
> xmlns="generalinformation">
>      <xf:generalinformation/>
>     </xf:testform>
>
> If I selected 'England' and 'London' in the form, I was expecting an
> xml file containing these values and I expected to need to create an
> xslt file for a csv file to be produced. What is my mistake to create
> the xml file?
>
> yours,
>
> xforms@conference.jabber.org
>
>
>

Received on Thursday, 12 August 2010 18:39:40 UTC