-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add type=xml-internal and generate instance XML from choices sheet #176
Comments
Thanks for this. I think the use cases (vs. external data) are situations where the data is not used across forms, or where the user prefers an easier-to-understand (all-in-one xls file) method. Do you think the XML structure should be the same I don't have a strong preference for using the existing |
Yes, I think using the It's also not totally clear to me whether adding a
I think if someone understands that choices can be used for arbitrary calculations having two sheets won't be confusing. But for someone who doesn't know how they're related conflating the two seems more confusing to me. Hoping we get some other opinions on this! |
Interested with this one. |
So if I'm getting this right, the idea is basically:
Update 05.03PM:
|
That's right. Please also note that the same list could also be used as a select. In that case, the instance should only be created once. Additionally, there may be more data columns specified beyond I'm leaning towards keeping all data list definitions on the |
After reading and poking around the code, I find an odd behavior. If the parser encounter So if you have form like this:
You will ended up with form like the following. It could be an expected behavior, or maybe this is a bug?
|
#383 looks like it was close. Closing that so it can be picked up again. |
Looking at this again, I'm not very enthusiastic about the The issue described at #176 (comment) is tracked at #387 |
Alternative: introduce a new type
This is in conflict with the first point I brought up at #107 (comment) I don't find it as compelling anymore. This would overlap with A related option is to use |
Seems an elegant solution! 👍
or |
#603 (Always generate secondary instance for selects) is completed so I think this use case can be achieved with selects. If a new question type is still preferred then please re-open. |
As a form designer, I want to be able to specify static data sets that can be queried from the form. Currently this can be hacked with
selects
andchoice-filter
but it's not elegant (e.g. https://docs.google.com/spreadsheets/d/1mQGVWaJA4QQp3jtddMdcRSDjc1O-j_bB79GUnlj5k10/edit#gid=0 where we want to specify a lookup table without needing an external file).#107 added type
xml-external
to specify an external XML instance that can be queried from within the primary instance.xml-internal
would work the same way but create an internal secondary instance. This is useful for specifying additional settings as described in #66 or including small, static data sets that are useful to do XPath queries on.The internal secondary instance named
mydata
would be generated from themydata
list on the choices sheet.Alternate ideas for instance generation
For this to be useful, pyxform should also generate the instance. This could be done from the existing choices sheet which has very similar behavior currently. If going this route, it might be necessary to change the rules that govern whether or not a column's values are included in an instance. Currently columns other than name/value and label are only included if there's a choice-filter that uses it. For more generic data sets `choice-filter` doesn't make sense. For example, the rule could be changed to something like if any row in this list specifies a value in the column, include it.Alternately, another sheet with name something like
datasets
could be introduced. The benefit there is thatname
andlabel
wouldn't need to be required and a different rule for including columns could easily be introduced.Instance generation should be possible for
xml-external
as well (much like the itemsets.csv file is generated).The text was updated successfully, but these errors were encountered: