Got more questions? Find advice on: ASP | SQL | Regular Expressions | Windows
in Search
Welcome to XmlAdvice Sign in | Join | Help

XML Serialization

Last post 07-08-2008, 13:53 by homiesite. 0 replies.
Sort Posts: Previous Next
  •  07-08-2008, 13:53 43904

    XML Serialization

    Hi Everyone,

    I need help with XML Serialization.  I have to create an array for multiple xml tags that are being returned by a server.  I am able to recieve these tags fine, but I am having trouble getting the attributes as well. 

    This is the XML that is being returned from the server.....

    <EmailAddressList>

       <EmailAddress Type="Business">somebody@website.com</EmailAddress>

       <EmailAddess Type="Business">someone@website.com</EmailAddress>

    </EmailAddressList>

    Here is my code.....

    private string[] emails;

    [XmlArray(ElementName="EmailAddressList")]

    [XmlArrayItem(ElementName="EmailAddress")]

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    [XmlArrayItem(ElementName="EmailAddress")]

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    [XmlArrayItem(ElementName="EmailAddress")]

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    public string[] Emails

    {

    get

    {

    {

    get

    {

    {

    get

    {

    return emails;

    }

    set

    {

    emails = value;

    }

    }

    set

    {

    emails = value;

    }

    }

    set

    {

    emails = value;

    }

    return emails;

    }

    set

    {

    emails = value;

    }

    }

    set

    {

    emails = value;

    }

    }

    set

    {

    emails = value;

    }

    return emails;

    }

    set

    {

    emails = value;

    }

    }

    set

    {

    emails = value;

    }

    }

    set

    {

    emails = value;

    }

    }

    }

    This code sets up the array to retrieve the email addresses, but no matter what I've tried, I can't get the attribute Type="Business".  Can anyone help me with a way I can retieve the attribute for this tag in the array?  Any help would be greatly appreciated. Thanks!

     

     

    This code sets up the array to retrieve the email addresses, but no matter what I've tried, I can't get the attribute Type="Business".  Can anyone help me with a way I can retieve the attribute for this tag in the array?  Any help would be greatly appreciated. Thanks!

     

     

    This code sets up the array to retrieve the email addresses, but no matter what I've tried, I can't get the attribute Type="Business".  Can anyone help me with a way I can retieve the attribute for this tag in the array?  Any help would be greatly appreciated. Thanks!

     

     

     

View as RSS news feed in XML