I've not had any experience doing this. However I would think this would be
possible in one of two ways:
1) An XSLT transformation. Basically the output from InfoPath would get
picked up by some type of job that would use an XSLT file to change the
format from the Inofpath format to the new format. I've not personally done
this, but do know that this is possible.
2) Setting up Infopath to use this format. When you create a form it asks
if you want to base it on an XML file or schema. It's just a matter of
pointing it to this file you provided and then creating the form based on
these fields. A couple of things to consider. Since the form is based on a
schema, it will lock down the fields in the form (you won't be able to change
the names or add additional attributes to a field). You will be able to
change the field and attribute values, but not the actual field and attribute
names. There are ways around all of this, but are a bit more difficult to
do, you need to have a good understanding of XML to change this. i'd suggest
starting small, playing with it to better understand the difficulties you may
have using this approach. The great thing about this approach is that if
your output file format is 100% fixed, meaning you won't need to make format
changes to it, then this should be a good approach. After opening the file
in InfoPath, it's just a matter of dragging the fields onto the form and
viola! a form that will easily create this file.
-Using the XML you provided, I changed 1 thing. I closed the first <E>
entry </E> and didn't embed E entries inside other E entries. (You can do
this, but I'm not sure how well InfoPath will deal with this... it is very
picky about the XML being in a valid format).
-Created an IP form based on that, dragged the fields to the form and filled
out the form (adding 4 A Items to the form).
-If you don't want the MSInfoPath Added lines, you'll have to process the
file after output (like I explain above in 1).
The output is below:
<?xml version="1.0" encoding="UTF-8"?>
<?mso-infoPathSolution solutionVersion="1.0.0.1" productVersion="11.0.6565"
PIVersion="1.0.0.0"
href="file:///D:\Documents%20and%20Settings\kchanget\My%20Documents\Template4.xsn" name="urn:schemas-microsoft-com
ffice:infopath:Template4:" ?>
<?mso-application progid="InfoPath.Document"?>
<Entities
xmlns:my="
http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-09-24T15:54:40" xml:lang="en-us">
<E Profiles="ABCZYX" Members="1000,1015," Title="Sage MMS Data"
Description="Group" Email="(e-mail address removed)"></E>
<E Profiles="1016," Members="1000," Title="Accounts" Description="Accounts
Entity" Email="(e-mail address removed)">
<I Title="Accounts Document" Description="Accounts Documentation"
Entity="!Accounts">
<T Entity="!Accounts" Title="Purchase Invoice" InformationType="Accounts
Document" Description="Purchase Invoice">
<A Entity="!Accounts" Template="Purchase Invoice" Title="Account Number"
InformationType="Accounts Document" Description="Account Number"
AttributeType="String">This is item 1</A>
<A Entity="!Accounts" Template="Purchase Invoice" Title="Account Number"
InformationType="Accounts Document" Description="Account Number"
AttributeType="String">This is item 2</A>
<A Entity="!Accounts" Template="Purchase Invoice" Title="Account Number"
InformationType="Accounts Document" Description="Account Number"
AttributeType="String">This is item 3</A>
<A Entity="!Accounts" Template="Purchase Invoice" Title="Account Number"
InformationType="Accounts Document" Description="Account Number"
AttributeType="String">This is Item 4</A>
<A Entity="!Accounts" Template="Purchase Invoice" Title="Sage Company
Name" InformationType="Accounts Document" Description="Sage Company Name"
AttributeType="String"></A>
</T>
</I>
</E>
</Entities>
There may be other possible ways that this can happen that I'm not aware of,
like I said, I've not really had to do this.
Hope this helps.
Kevin