[Xml-compile] bug(s) in compilation of a "choice" element?

Anton Berezin tobez at tobez.org
Fri Feb 5 22:27:44 GMT 2010


On Fri, Feb 05, 2010 at 09:51:39PM +0000, Oliver Gorwits wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> I thought I'd quickly post to the list what I think might be a bug,
> but could equally simply be me being new to this SOAP business...
> 
> I have the following in the .xsd files[1]:
> 
>   <xs:element name="ParentFolderIds"
> type="t:NonEmptyArrayOfBaseFolderIdsType"/>
> 
>   <xs:complexType name="NonEmptyArrayOfBaseFolderIdsType">
>     <xs:choice maxOccurs="unbounded" minOccurs="1">
>       <xs:element name="FolderId" type="t:FolderIdType"/>
>       <xs:element name="DistinguishedFolderId"
> type="t:DistinguishedFolderIdType"/>
>     </xs:choice>
>   </xs:complexType>
> 
> Which I believe should accept the following Perl data structure:
> 
> ParentFolderIds => {
>   cho_DistinguishedFolderId => [{
> 	Id => 'contacts',
>         Mailbox => { EmailAddress => 'nobody at example.com' }
>   }],
> }

I *think* (it's been a while since I did the Exchange WS with XML::Compile)
that the following will do the trick:

	ParentFolderIds => {
		cho_FolderId => [
			{ DistinguishedFolderId =>
				{
					Id => "contacts",
					Mailbox => { EmailAddress => "nobody at example.com" }
				}
			}
		]
	}

\Anton.
-- 
Matters of elegance ought to be left to the tailor and to the cobbler.
  -- L. Boltzmann



More information about the Xml-compile mailing list