简体   繁体   中英

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

I have the XSD schema definition loaded ( XDocument variable type) I can't figure out how to get the someProperty value. Any ideas ?

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

Simple with LINQ to XML:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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