Posted by
Erik Bruchez on
URL: https://discuss.orbeon.com/adding-elements-to-existing-data-tp44007p44008.html
> I'm new to Orbeon, and really like it so far.
Thanks!
> I've built my first form,
> which is basically a revised version of the Bookcast example
> application, and I've come up with a couple of questions.
>
> * I've added an element to my form, and it works just fine for new
> entries, but there's no entry field for existing entries. I'd like a
> blank field (or maybe filled out w/ a default value) to show up for
> existing entries. What's the right approach here? I can add an
> empty
> element in my eXist database directly - but is that the
> usual/recommended approach?
The larger issue is: how to migrate data from a version v1 of an XML
schema (as in "structure of an XML document", not as in "W3C XML
Schema") to version v2?
In general answer is not easy.
For your specific case, since you know what changed, I think that yes,
you could migrate all of your existing data by simply adding a blank
element to all your documents. If you are using eXist, this should be
easy with just a bit of XQuery.
> * I've noticed that when validating my form against a schema, that
> date
> type elements automatically get a date picker added to them. Nice!
> However, it only show up _after_ I've added a date. How can I turn
> that on for the initial date entry?
If the data type is not correct (an empty string is not an xs:date!),
the schema validator we are using does not report that the element
contains a value of type xs:date.
In this case, you better use an additional bind:
<xforms:bind nodeset="..." type="xs:date"/>
or:
<xforms:bind nodeset="..." type="xforms:date"/>
-Erik
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: mailto:
[hidden email]
For general help: mailto:
[hidden email]?subject=help
OW2 mailing lists service home page:
http://www.ow2.org/wws