xml中怎么添加noNamespaceSchemaLocation和xsi
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-
envelope.xsd">
XmlDocument xmldoc = new XmlDocument();
XmlElement xmlelem;
XmlElement data;
xmlelem = xmldoc.CreateElement("", "AmazonEnvelope", "");
//xmlelem.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
//xmlelem.SetAttribute("xsi","noNamespaceSchemaLocation", "amzn-envelope.xsd");
XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance";
XAttribute att = new XAttribute(xsi + "noNamespaceSchemaLocation", "amzn-envelope.xsd") ;
我直接用setAttribute不行
网上有一个用XDocument的但是我用的是XmlDocument,不想改了
envelope.xsd">
XmlDocument xmldoc = new XmlDocument();
XmlElement xmlelem;
XmlElement data;
xmlelem = xmldoc.CreateElement("", "AmazonEnvelope", "");
//xmlelem.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
//xmlelem.SetAttribute("xsi","noNamespaceSchemaLocation", "amzn-envelope.xsd");
XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance";
XAttribute att = new XAttribute(xsi + "noNamespaceSchemaLocation", "amzn-envelope.xsd") ;
我直接用setAttribute不行
网上有一个用XDocument的但是我用的是XmlDocument,不想改了
...全文
相关推荐
ofbiz 部署一个新网站
ofbiz 部署一个新网站,一个简单的方法利用ofbiz去建立一个新网站
Spring Boot 简单使用EhCache缓存框架的方法
本篇文章主要介绍了Spring Boot 简单使用EhCache缓存框架的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Schema学习总结
细致全面的Schema的学习总结,适合与初学者
使用ehcache三步搞定springboot缓存的方法示例
本次内容主要介绍基于Ehcache 3.0来快速实现Spring Boot应用程序的数据缓存功能。小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
易语言源码易语言节点与XML转换模块源码
易语言源码易语言节点与XML转换模块源码


.NET Framework
