Repeating element in XML Schema in Infopath form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Repeating element in XML Schema in Infopath form

Last post 01-26-2007 07:50 AM by tfsjohan. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-26-2007 05:47 AM

    Repeating element in XML Schema in Infopath form

    I have a XML Schema with a repeating section. The schema looks something like this:

    myFields
    Name (element)
    Email (element)
    Question (group)
    QuestionId (attribute)
    QuestionText (element)
    Answer (element)

    I would like to create a InfoPath forms that displays X questions, but stores the data based on this schema.

    This is just fine when I edit the view my self and edit template.xml and enter all my questions. It works just fine in preview mode, but when I have the form in design mode in InfoPath it complains about errors in the fields. The design checker in InfoPath 2007 also marks all my questions as errors.

    How can I create a form with X questions without creating a totally worthless schema?

    Please help!

    // Johan
  • 01-26-2007 07:29 AM In reply to

    Re: Repeating element in XML Schema in Infopath form

    Hello Johan and welcome to forums,
    You can make Question (group) as repeating and set the maxoccurs of that repeating group to X in Schema (.xsd file). This will allow you to enter only X Questions in InfoPath form.

    Hope this helps!
  • 01-26-2007 07:50 AM In reply to

    Re: Repeating element in XML Schema in Infopath form

    Thank you for your reply, but I think you misunderstood me or that I didn't explain it good enough. :)

    What I would like to do is have say 10 predefined questions in the form. The users should not be able to add their own questions, just answer the existning ones.

    What I did with the template.xml was to add all my questions. Then I made a few changes to the view1.xslt so that all the questions was displayed. This works just fine in preview mode, but in design mode I get some errors on the textboxes. The error is "The control cannot store data correctly", but it works just fine in preview mode. Data is stored just the way I want.

    Normally I would not care about the errors in design time, but since I aim to publish it to a forms server I need to get rid of the errors.

    If it helps I could put the form on a web site where you can look at it and see the schema, template.xml and view1.xslt changes.

    // Johan
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.