quote:
Originally posted by Greg Collins
Using XML Spy to create a similar schema, I find that I am blocked at adding an attribute to an enumarated node, and I am blocked at adding enumerations to a node with an attribute.
Actually, my example (above) was made using XMLSpy. You can do it too. First create a global simpleType for the enumeration, then create a global complexType that extends the simpleType and adds the attribute, and finally create an element that uses the complexType.
I researched how to do this in XML Schema. That's not the problem. The problem is that InfoPath won't allow you to edit the display values.
What's frustrating is that InfoPath actually
supports this schema -- it just won't let you changes the values while editing. If you take the example I gave (above) and paste it into XMLSpy, it will be valid. If you then build a form in InfoPath using the schema, you'll see my problem when you try to edit the values for the List Box.
But, if you preview the same form in InfoPath, it works! The only problem is in the InfoPath editor.
I've tried adding the attribute to the XML template, hoping that its presence would be enough to make the enumerated values valid while editing the form...but no luck.
What's also frustrating me is that this seems like such a simple element. For example:
<state hometown="yes">California</state>
where <state> has an enumerated list of possible answers, but also has an attribute. I dunno; it doesn't seem that complex to me.
As it stands, InfoPath forces me to use something like:
<state>
<value>California</value>
<hometown>yes</hometown>
</state>