M
Matt
I'm wondering if it's possible, using infopath, to programattically generate
and publish an Infopath form template (which will be based on an XML schema)
using an existing XML data document.
Here's an example. I want to dynamically create an Infopath form that will
act as a grocery list. It will have a list of grocery items and a checkbox
next to each item which I'll use to indicate whether it has been purchased.
The schema for a grocery list form to be created would basically be:
<xs:schema>
<xs:element name="groceryList">
<xs:element name="listEntry" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="hasBeenPurchased" type="xs:boolean"/>
<xs:element name="itemName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:element>
</xs:schema>
What I want to do is grab a separate existing XML data document (e.g. below)
with a list of item names and produce an infopath form.
<xml data document>
<item>Apples</item>
<item>Oranges</item>
<item>Loaf of bread</item>
</xml data document>
Then I want Infopath to build a form based on the items in that list based
on the schema above. It would look like this:
<Infopath form>
[checkbox]Apples
[checkbox]Oranges
[checkbox]Loaf of bread
</Infopath form>
So that you understand the rationale of why I want to do this, it's because
I don't want end users to have to go into edit mode and manually type in
Apples, Oranges, etc. I want one user to enter item names into a form and
save a resulting XML data document from it. Then I want Infopath to grab the
XML document that was just created and transform it into an Infopath form
that also includes a checkbox in front of each item.
In reality, of course, what I want to do is much more complex than this.
But fundamentally, I can't determine from my reading about Infopath whether
this is feasible or even possible. If it's not possible, please let me know.
You'll save me a bunch of time because I'll stop chasing my tail. If it is
possible, can you offer me any guidance on how this can be done.
Thanks in advance,
Matt
and publish an Infopath form template (which will be based on an XML schema)
using an existing XML data document.
Here's an example. I want to dynamically create an Infopath form that will
act as a grocery list. It will have a list of grocery items and a checkbox
next to each item which I'll use to indicate whether it has been purchased.
The schema for a grocery list form to be created would basically be:
<xs:schema>
<xs:element name="groceryList">
<xs:element name="listEntry" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="hasBeenPurchased" type="xs:boolean"/>
<xs:element name="itemName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:element>
</xs:schema>
What I want to do is grab a separate existing XML data document (e.g. below)
with a list of item names and produce an infopath form.
<xml data document>
<item>Apples</item>
<item>Oranges</item>
<item>Loaf of bread</item>
</xml data document>
Then I want Infopath to build a form based on the items in that list based
on the schema above. It would look like this:
<Infopath form>
[checkbox]Apples
[checkbox]Oranges
[checkbox]Loaf of bread
</Infopath form>
So that you understand the rationale of why I want to do this, it's because
I don't want end users to have to go into edit mode and manually type in
Apples, Oranges, etc. I want one user to enter item names into a form and
save a resulting XML data document from it. Then I want Infopath to grab the
XML document that was just created and transform it into an Infopath form
that also includes a checkbox in front of each item.
In reality, of course, what I want to do is much more complex than this.
But fundamentally, I can't determine from my reading about Infopath whether
this is feasible or even possible. If it's not possible, please let me know.
You'll save me a bunch of time because I'll stop chasing my tail. If it is
possible, can you offer me any guidance on how this can be done.
Thanks in advance,
Matt