开发者

adding xmlns:rim attribute to serialized class

I would like to add a namespace and prefix attribute to my serialzed class so my child elements can reference by using the prefix.

My class looks like this:

    [System.CodeDom.Compiler.Gene开发者_JAVA技巧ratedCodeAttribute("svcutil", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.opengis.net/cat/csw/2.0.2")]
    public partial class SearchResultsType
    {

        private object[] itemsField;

        private string resultSetIdField;

        private ElementSetType elementSetField;

        private bool elementSetFieldSpecified; 
...

Right now it's returning this:

<SearchResults recordSchema="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
    <RegistryPackage id="urn:ogc:def:registryPackage:OGC-CSW-ebRIM-EO::EOProducts" objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:RegistryPackage"/>
</SearchResults>

And i want it to loom more like this:

<SearchResults xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" recordSchema="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
    <rim:RegistryPackage id="urn:ogc:def:registryPackage:OGC-CSW-ebRIM-EO::EOProducts" objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:RegistryPackage"/>
</SearchResults>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜