繁体   English   中英

C#XSD架构-如何获取主要属性值?

[英]C# XSD schema - how to get main properties values?

我已经加载了XSD架构定义( XDocument变量类型),我不知道如何获取someProperty值。 有任何想法吗 ?

<xsd:form-definition xmlns:xsd="http://url/lorem.xsd"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     ...
     someProperty="ABC">
 ...
</xsd:form-definition>

使用LINQ to XML很简单:

var attributes = (from n in xml.Root.Attributes("someProperty")
                        select n.Value).ToList();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM