Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XForm language #229

Closed
adammichaelwood opened this issue Sep 28, 2017 · 8 comments
Closed

XForm language #229

adammichaelwood opened this issue Sep 28, 2017 · 8 comments

Comments

@adammichaelwood
Copy link
Contributor

We need to talk about the meaning and usage of several words and concepts related to XML and XForms.

  • block
  • instance
  • model
  • variable

(Probably a few other things.)

Between @mish24's work on pulling in the Form Design documents, and my work on the OpenRosa standards, this is becoming critical to clear-headed thinking and writing... and my current feelings are that the existing documentation and specs don't make these as clear as they should, and there are some inconsistencies in the way things are talked about.

I'm going to review the XForm specification and gather a few examples.

@adammichaelwood
Copy link
Contributor Author

adammichaelwood commented Sep 28, 2017

What is the name of the element immediately inside <instance>, which (seems to) define the form's structure?

In existing docs, the following structure is discussed and shown by example:

<instance>
          <data xmlns:jr="http://openrosa.org/xforms"
                id="example.org:myFormId"
                version="1" >

but that element isn't always labeled data -- for example, in the all-widgets form (as output by the online XLSForm utility):

<instance>
  <all-widgets id="all-widgets" version="2017061601">

In at least one doc, this element is called "an instance".

@adammichaelwood
Copy link
Contributor Author

What does the word model mean?

  • Does it mean different things in different contexts?
  • Can we limit its meaning to one thing going forward?

Some of the documentation seems to refer to a blank form as a "model", but it isn't always clear if "model" in that context refers to the whole XML document, or just a portion of it.

Meanwhile, model is an element in a blank XForm.

@adammichaelwood
Copy link
Contributor Author

What is the relationship between the blank XForm and the XForm that represents a complete form?

In reality (I think), a person answers a bunch of question in-app, and a new XML document is generated to include those answers. But some of the documentation seems to suggest a mental model in which the XForm is "filled in" and submitted.

I know some of this is just due to the mental model of filling-in paper forms. But the suggestion is that the completed form is a copy of the blank form, but with response data added to it. But then, when I look at actual blank forms and their completed instances, this doesn't seem to be precisely the case.

@lognaturel
Copy link
Member

At a high level, I think that all things XForms and XML should now live in the developer docs with most of it at https://opendatakit.github.io/xforms-spec/. There are some rare cases in which users may want to edit XML but I don't think it happens commonly at all. That has some implications for @mish24's #217, I think the contents there will need to be heavily revised. It would be ok to first pull it in as-is and then find homes for the different pieces as long as it's made very clear that today people generally don't need to touch the XML. @mish24 and @adammichaelwood have already been discussing this in the comments there.

Consider submitting clarification pull requests to https://opendatakit.github.io/xforms-spec/

I'd have to see the context but I imagine "block" just refers to a container tag and its children.

I think the description of instance and model at https://opendatakit.github.io/xforms-spec/#instance should be augmented with some of the information in the abstract at https://www.w3.org/TR/xforms/

The child of the primary instance can have any name. I think this is well described at https://opendatakit.github.io/xforms-spec/#primary-instance

@adammichaelwood
Copy link
Contributor Author

The child of the primary instance can have any name. I think this is well described at https://opendatakit.github.io/xforms-spec/#primary-instance

I gathered the tag can have any label. Do we refer to that abstract idea as anything other than "the child of the instance"?

@adammichaelwood
Copy link
Contributor Author

I imagine "block" just refers to a container tag and its children.

It does. But the more precise word would be "element" or "document node"

@adammichaelwood
Copy link
Contributor Author

it's made very clear that today people generally don't need to touch the XML.

This fact, by itself, covers a multitude of issues.

@adammichaelwood
Copy link
Contributor Author

a solution to most of the general problem here has, I think, emerged.
Some specific conversation around the definition of "form" (#605) might go somewhere,
but I think this issue can go away...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants