[Mono-list] Probleme with XML

Julien Sobrier julien at sobrier.net
Sat Aug 19 13:42:26 EDT 2006


Andreas Färber wrote:
> 
> Am 19.08.2006 um 07:48 schrieb Julien Sobrier:
> 
>> Hello,
>> I have an XML that looks like this (simplified):
>> <schemafile>
>>     <schemalist module="xxxx">
>>         <schema>
>>             ...
>>         </schema>
>>         <schema>
>>             ....
>>         <schema>
>>     </schemalist>
>> </schemafile>
>>
>> I have the corresponding C# objects (simplified also):
>>
>> [XmlRoot("schemafile")]
>> public class Schemafile
>> {
>>     private Module module;
>>     [XmlElement("schemalist", typeof(Module))]
>>     public Module ModuleName
>>     {
>>         get { return module; }
>>         set { module = value; }
>>     }
>> }
>>
>>
>> public class Module
>> {
>>     [XmlElement("schema", typeof(Setting))]
>>     public ArrayList SchemaList = new ArrayList();
> 
> Try XmlArrayAttribute above. You're trying the map a single element to
> an ArrayList.
> 
> Andreas

Thank you. I tried XmlArrayAttribute, XmlArray, XmlArrayItem, but with
all of them, no XML parsing is done at all.

Julien


More information about the Mono-list mailing list