Get namespace from xml file C#

后端 未结 3 953
北荒
北荒 2021-02-13 18:30

I\'ve browsed the questions with similar titles but cannot seem to find exactly what I\'m looking for,if anyone spotted a similar question kindly point me to the thread.Here is

3条回答
  •  爱一瞬间的悲伤
    2021-02-13 18:39

    Thats because the default namespace is blank / not specified. I'd guess that you want GetNamespaceOfPrefix:

    string elementNamespace = elemet.GetNamespaceOfPrefix("xs").NamespaceName;
    

    Although that doesn't make a whole lot of sense to be honest - I'm not really sure what you are after.

提交回复
热议问题