簡體   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