Results 1 to 2 of 2

Thread: [2.0] Serializing a c# object to Xml - Please help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Location
    Madrid
    Posts
    325

    [2.0] Serializing a c# object to Xml - Please help

    Hello,

    I am trying to serialize a c# object to a XML document.

    The thing is, it needs a "xsi:schemaLocation" attribute.

    I am using the xmlSerializer.

    I have tried;

    1)
    Code:
     [XmlAttributeAttribute("schemaLocation")]
            public string xsiSchemaLocation = "http:// bla bla, whatever.xsd"
    also this

    2)
    Code:
     [XmlAttributeAttribute("schemaLocation", namespace="somenamespace")]
            public string xsiSchemaLocation = "http:// bla bla, whatever.xsd"
    This gives me a good result, but for some reason
    it returns, "d1p1:schemaLocation" instead of "xsi:schemaLocation" , also adds some extra information which I do not want.

    Any help would be greatly appreciated,
    Thanks,
    Rauland

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2.0] Serializing a c# object to Xml - Please help

    Does your schema override any elements, does it contain the d1p1 namespace?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width