Creating form with a predifened output xml

M

madhur

Hello

I want to create an infopath form with output xml like this :
<a>
<b>
....
</b>
</a>

<c>
<b>
.....
</b>
</c>

Note that the XML element *b* here have the same name but contain
entirely different data and child elements. I am facing the problem of
not creating the element with the same name again in other place in
the XML. Is this a restriction ? How can I overcome it ?

This XML output is one of our organization standard. So I cannot
violate it. How can I generate this type of XML from infopath form.

Regards,
MAdhur
 
S

S.Y.M. Wong-A-Ton

You can make the two b's unique (that is, contain different data) by defining
a different namespace on each one of them. InfoPath will not prohibit you to
use the b twice. However, it *will* assume that the two b's contain the same
data if the opposite hasn't been defined.
 
M

madhur

You can make the two b's unique (that is, contain different data) by defining
a different namespace on each one of them. InfoPath will not prohibit you to
use the b twice. However, it *will* assume that the two b's contain the same
data if the opposite hasn't been defined.

Thanks for the reply. But dont you think , changing the name space
will result in
the violation of standard. If I understand, the output of XML should
contain only one
namespace unless mentioned by the standard. Either I am missing
something or the
standard itself is poorly defined. What do you think ?

Madhur
 
S

S.Y.M. Wong-A-Ton

I'm not sure which standard you're talking about, but I'm assuming you mean
the organization's standard? Well... I cannot be the judge of whether it is
poorly defined or not. :) Obviously there must have been a reason to choose
just one namespace, but XML does not dictate that you must use only one
namespace in a document - and neither does InfoPath.

If the namespace is not defined in the XML or XSD, unfortunately, it will be
in violation of the organization's standard.
 
S

S.Y.M. Wong-A-Ton

I forgot to mention that you could define the b in such a way that it
contains anything. But I guess that would also be in violation of the
standard if certain elements are expected to appear in each b element. Just
out of curiosity: Was an XSD defined for this XML?
 
M

madhur

I forgot to mention that you could define the b in such a way that it
contains anything. But I guess that would also be in violation of the
standard if certain elements are expected to appear in each b element. Just
out of curiosity: Was an XSD defined for this XML?

Hello

Actually I am talking about the Acord(www.acord.org) standard for
insurance. If you have any idea about
this standard, do let me know.

Madhur
 
S

sajithkumartg

Hello

I want to create aninfopathform with output xml like this :
<a>
<b>
...
</b>
</a>

<c>
<b>
.....
</b>
</c>

Note that the XML element *b* here have the same name but contain
entirely different data and child elements. I am facing the problem of
not creating the element with the same name again in other place in
the XML. Is this a restriction ? How can I overcome it ?

This XML output is one of our organization standard. So I cannot
violate it. How can I generate this type of XML frominfopathform.

Regards,
MAdhur

Hi Madhur

I am not sure if you are using Office 2007 or not. I have found that
InfoPath 2007 has a facility called Reference fields, by which you can
create two fields with same name under two different groups. Using
this feature, I was able to create the following XML, which seems to
be in lines with your example:

<?xml version="1.0" encoding="UTF-8"?><?mso-infoPathSolution
solutionVersion="1.0.0.3" productVersion="12.0.0" PIVersion="1.0.0.0"
href="file:///C:\Documents%20and%20Settings\sajlggo\Local%20Settings
\Application%20Data\Microsoft\InfoPath\Designer2\e53d7f9946144a8a
\manifest.xsf" ?><?mso-application progid="InfoPath.Document"
versionProgid="InfoPath.Document.2"?><my:myFields xmlns:my="http://
schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-11T04:39:59"
xml:lang="en-us">
<my:A>
<my:B>Sajith</my:B>
</my:A>
<my:C>
<my:B>Kumar</my:B>
</my:C>
</my:myFields>

Thanks
Sajith
 
M

madhur

Hi Madhur

I am not sure if you are using Office 2007 or not. I have found thatInfoPath2007 has a facility called Reference fields, by which you can
create two fields with same name under two different groups. Using
this feature, I was able to create the following XML, which seems to
be in lines with your example:

<?xml version="1.0" encoding="UTF-8"?><?mso-infoPathSolution
solutionVersion="1.0.0.3" productVersion="12.0.0" PIVersion="1.0.0.0"
href="file:///C:\Documents%20and%20Settings\sajlggo\Local%20Settings
\Application%20Data\Microsoft\InfoPath\Designer2\e53d7f9946144a8a
\manifest.xsf" ?><?mso-application progid="InfoPath.Document"
versionProgid="InfoPath.Document.2"?><my:myFields xmlns:my="http://
schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-11T04:39:59"
xml:lang="en-us">
<my:A>
<my:B>Sajith</my:B>
</my:A>
<my:C>
<my:B>Kumar</my:B>
</my:C>
</my:myFields>

Thanks
Sajith- Hide quoted text -

- Show quoted text -

Hi Sajith

I am aware of the field referencing. But in the current standard,
there are some field names with same names having entirely different
child names. This results in the duplication of fields and this may
result in the redundant fields.

Thanks
Madhur
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top