모델 :XmlDeserialization : 점 xmlconverter에 대한
[XmlRoot(ElementName = "location", IsNullable = true)]
public class location
{
public string city { get; set; }
public string country { get; set; }
public string street { get; set; }
public string postalcode { get; set; }
[XmlElement(ElementName = "geo:point")]
public geoLocation geo { get; set; }
}
[XmlRoot(ElementName = "geo:point", Namespace="http://www.w3.org/2003/01/geo/wgs84_pos#")]
public class geoLocation
{
[XmlElement(ElementName = "geo:lat", Namespace="http://www.w3.org/2003/01/geo/wgs84_pos#")]
public string lat { get; set; }
[XmlElement(ElementName = "geo:long", Namespace = "http://www.w3.org/2003/01/geo/wgs84_pos#")]
public string lon { get; set; }
}
XML :
<location>
<city>Moscow</city>
<country>Russian Federation</country>
<street></street>
<postalcode>236000</postalcode>
<geo:point>
<geo:lat>54.727483</geo:lat>
<geo:long>20.501132</geo:long>
</geo:point>
</location>
위치 확인하지만, 지리적 - 없습니다. 어떻게해야합니까? 나는 네임 스페이스를 삭제하기 위해 노력하고 XmlElement
속성 정의의 일부로 변경
지리적 뭐가 문제 - 당신이 볼 것으로 예상 했습니까? –