RE:Empty Repeats

Hi Raman,

For non-deterministic schemas as in choice, what if we select the 'first'
choice as the default, if the instance doesn't specify any? 

There are precedents to this in XForms spec itself as in switch/toggle
(http://www.w3.org/TR/xforms/slice9.html#id2628841)
"If multiple cases within a switch are marked as selected="true", the first
selected case remains and all others are deselected. If none are selected,
the first becomes selected."

Wouldn't this assumption eliminate the requirement of at least one instance
node for repeats?

Regards,
Shailesh

-----Original Message-----
From: T. V. Raman [mailto:tvraman@us.ibm.com]
Sent: Thursday, January 23, 2003 12:49 PM
To: Guillermo Menéndez
Cc: www-forms@w3.org
Subject: Empty Repeats




there s a good reason why the spec says the instance should at least
have one template element, here is the reasoning why:

0) Element <instance> is a declaration --
and is needed --even if you have a schema because given a schema, you
cannot always  come up with a deterministic answer for what a template
node looks like.

Thus, if you have a shopping cart holding a set of items, you need a
template for  what item looks like --having just the schema for
element "item" wont be enough because as an example, the schema might
use choice, or other alternation mechnaisms in specifying what an
"item" can contain.
>>>>> "Guillermo" == Guillermo Menéndez <gmcorral@terra.es> writes:


    Guillermo> Hello, I was trying to find a way to make a Repeat
    Guillermo> structure that could have no initial elements, or at
    Guillermo> least that could display no elements when the form is
    Guillermo> loaded. This is because I'm using XForms to process
    Guillermo> external documents that maybe not always provide
    Guillermo> instance data for some of the Repeats. I have looked in
    Guillermo> the specification and it clearly says that initial
    Guillermo> instance data must be provided to construct the members
    Guillermo> to the homogeneous collection, but I though that maybe
    Guillermo> there is a way such as copying the repeat data from an
    Guillermo> inline instance, but I couldn't make it work. If anyone
    Guillermo> have any idea it would be very appreciated.

    Guillermo> Another issue is that when deleting the last element of
    Guillermo> a Repeat structure, at least in X-smiles, it doesn't
    Guillermo> let you insert new nodes anymore, until the form is
    Guillermo> reloaded. Maybe this is only a bug of X-smiles, because
    Guillermo> the specification doesn't say anything about this.

    Guillermo> Regards,

    Guillermo> Guillermo<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Guillermo> Transitional//EN"> <HTML><HEAD> <META
    Guillermo> http-equiv=Content-Type content="text/html;
    Guillermo> charset=iso-8859-1"> <META content="MSHTML
    Guillermo> 6.00.2800.1106" name=GENERATOR> <STYLE></STYLE> </HEAD>
    Guillermo> <BODY bgColor=#ffffff> <DIV><FONT face=Arial
    Guillermo> size=2>Hello, </FONT></DIV> <DIV><FONT face=Arial
    Guillermo> size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial
    Guillermo> size=2>I was trying to find a way to make a Repeat
    Guillermo> structure that could have no initial elements, or at
    Guillermo> least that could display no elements when the form is
    Guillermo> loaded. This is because I'm using XForms to process
    Guillermo> external&nbsp;documents that maybe not always provide
    Guillermo> instance data for some of the Repeats. I have looked in
    Guillermo> the specification and it clearly says that initial
    Guillermo> instance data must be provided to construct the members
    Guillermo> to the homogeneous collection, but I though that maybe
    Guillermo> there is a way such as copying the repeat data from an
    Guillermo> inline instance, but I couldn't make it work. If anyone
    Guillermo> have any idea it would be very
    Guillermo> appreciated.</FONT></DIV> <DIV><FONT face=Arial
    Guillermo> size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial
    Guillermo> size=2>Another issue is that when deleting the last
    Guillermo> element of a Repeat structure, at least in X-smiles, it
    Guillermo> doesn't let you insert new nodes anymore, until the
    Guillermo> form is reloaded. Maybe this is only a bug of X-smiles,
    Guillermo> because the specification doesn't say anything about
    Guillermo> this.</FONT></DIV> <DIV><FONT face=Arial
    Guillermo> size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial
    Guillermo> size=2>Regards,</FONT></DIV> <DIV><FONT face=Arial
    Guillermo> size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial
    Guillermo> size=2>Guillermo</FONT></DIV></BODY></HTML>

-- 
Best Regards,
--raman
------------------------------------------------------------
T. V. Raman:  PhD (Cornell University)
IBM Research: Human Language Technologies
Architect:    Conversational And Multimodal WWW Standards
Phone:        1 (408) 927 2608   T-Line 457-2608
Fax:        1 (408) 927 3012     Cell: 1 650 799 5724
Email:        tvraman@us.ibm.com
WWW:      http://www.cs.cornell.edu/home/raman
AIM:      TVRaman
PGP:          http://emacspeak.sf.net/raman.asc
Snail:        IBM Almaden Research Center,
              650 Harry Road
              San Jose 95120


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************

Received on Friday, 24 January 2003 09:36:34 UTC