反序列化根目录名有减号的XML,结果说XML有问题 本帖最后由 billsquall 于 2011-06-27 20:09:33 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 找到问题了<po-response xmlns='http://seller.etplace.sears.com/oms/v2'> was not expected.不懂 <po-response 这个是根目录?看提示是不能有po-response 红色部分 郁闷解决了,贴出代码xml2 = xml2.Replace("<po-response xmlns=\"http://seller.etplace.sears.com/oms/v2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://seller.etplace.sears.com/oms/v2 https://seller.etplace.sears.com/SellerPortal/s/schema/oms/purchaseorder-v2.xsd\">", "<po-response>");[Serializable] [XmlRoot("po-response")] public class PoResponse { [XmlElement("purchase-order")] public PurchaseOrder purchase_order { set; get; } } [Serializable] public class PurchaseOrder { [XmlElement("po-number")] public int po_number { set; get; } 如何实现多项重置? 关天报表问题,请教 我通过wmi 写的修改IP 总是执行不了 有代码 请问什么原因 请问有关WCF的一个基础问题 数组 反序列化如何实现查询 c#两个窗口传递变量 vs.net 2005上为何没OracleClient名称空间? webbrowser在打开网页时,会抢焦点,如何能让它不抢焦点 前三贴已结,再开一贴,继续散分,高兴!!!!!!!!!! 如何统计个数 求教~C# 委托
<po-response xmlns='http://seller.etplace.sears.com/oms/v2'> was not expected.不懂
<po-response 这个是根目录?看提示是不能有po-response 红色部分
xml2 = xml2.Replace("<po-response xmlns=\"http://seller.etplace.sears.com/oms/v2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://seller.etplace.sears.com/oms/v2 https://seller.etplace.sears.com/SellerPortal/s/schema/oms/purchaseorder-v2.xsd\">", "<po-response>");[Serializable]
[XmlRoot("po-response")]
public class PoResponse
{
[XmlElement("purchase-order")]
public PurchaseOrder purchase_order { set; get; }
} [Serializable]
public class PurchaseOrder
{
[XmlElement("po-number")]
public int po_number { set; get; }