我不确定如何在Google上搜索此内容,但是在XML文件中,xmlns元素是否重要呢? 我正在使用ASP.NET(VB)中的XMLWriter创建XML文件,并尝试匹配我收到的示例。
<ns2:SubmitSMReq xmlns:ns4="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:ns2="http://somesite/schema">
这是我在VB文件中的内容:
writer.WriteStartElement("ns2", "SubmitSMReq", "http://schemas.xmlsoap.org/soap/envelope/")
writer.WriteAttributeString("xmlns", "ns3", Nothing, "http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4")
writer.WriteAttributeString("xmlns", "ns4", Nothing, "http://somesite/schema")
但它生成的XML格式不同。
<ns2:SubmitSMReq xmlns:ns3="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:ns4="http://somesite/schema" xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/">
我意识到提供的例子中xmlns具有不同的“ns”(命名空间?)数字。这些东西有关系吗?我的文件是否没问题?
谢谢。