【发布时间】:2014-11-11 07:57:23
【问题描述】:
我正在构建获取买家送货地址的 eBay 应用程序
我打电话给GetOrdershttp://developer.ebay.com/devzone/xml/docs/reference/ebay/getorders.html
并收到此 xml 作为回报:
<AddressAttribute type="AddressAttributeCodeType"> AddressAttributeType (string) </AddressAttribute>
<AddressID> string </AddressID>
<AddressOwner> AddressOwnerCodeType </AddressOwner>
<CityName> string </CityName>
<Country> CountryCodeType </Country>
<CountryName> string </CountryName>
<ExternalAddressID> string </ExternalAddressID>
<Name> string </Name>
<Phone> string </Phone>
<PostalCode> string </PostalCode>
<ReferenceID> string </ReferenceID>
<StateOrProvince> string </StateOrProvince>
<Street1> string </Street1>
<Street2> string </Street2>
</AddressAttribute >
我正在尝试了解如何将送货地址转换为国际送货格式 http://en.wikipedia.org/wiki/Address_(geography)
这意味着:
如果国家/地区是Finland,则结果应为以下字符串:
Company
Name or Department
Street name + number + *apartment number (optional)
Postal code + Town
Country
如果国家/地区是Iceland,则结果应为以下字符串:
Name
Streetname + Number
Complements
Postal code + Place
如果国家是USA,那么结果应该是:
Name of addressee
House number and street name
Name of town, State abbreviation + ZIP code
(typical handwritten format)
等等
我怎样才能自动做到这一点?
【问题讨论】:
-
您可以在 C# 代码中读取 XML 文件并根据需要设置格式吗?