XSD在C#中的路径/节点顺序 [英] the path/node order of XSD in C#
本文介绍了XSD在C#中的路径/节点顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何跟踪xsd中的路径吗?
例如:如果我有此架构,
Does anyone have an idea about how keep track of a paths in xsd
For example: if I have this schema,
<<pre lang="xml">xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:books" xmlns:bks="urn:books">
<xsd:element name="books" type="bks:BooksForm"/>
<xsd:complexType name="BooksForm">
<xsd:sequence>
<xsd:element name="book" type="bks:BookForm" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="BookForm">
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="genre" type="xsd:string"/>
<xsd:element name="price" type="xsd:float" />
<xsd:element name="pub_date" type="xsd:date" />
<xsd:element name="review" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
</xsd:complexType>
</xsd:schema
>
我如何在c#
中得到这样的输出
path1:books.booksForm.book.bookForm.author
path2:books.booksForm.book.bookForm.title
...等等
适用于任何架构结构
有没有人对此有任何想法或任何好的起点
在此先感谢
>
how can I get like this output in c#
path1 : books.booksForm.book.bookForm.author
path2 : books.booksForm.book.bookForm.title
... so on
for any schema structure
does anyone have an idea about this or any good starting points
thanks in advance
推荐答案
您是否尝试过将LINQ转换为XSD?如果没有,请选中此
LINQ到XSD [
Have you tried LINQ to XSD?If not,check this
LINQ to XSD[^]
这篇关于XSD在C#中的路径/节点顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文