如何使用带有MsXML6的Delphi获取模式中的所有元素?

如何使用带有MsXML6的Delphi获取模式中的所有元素?,delphi,msxml,Delphi,Msxml,我对以下xsd有以下建议: <xs:schema xmlns="urn:bookroom-schema" targetNamespace="urn:bookstore-schema" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="book" type="xs:string" /> <xs:complexType name="booktype"> <xs:s

我对以下xsd有以下建议:

<xs:schema xmlns="urn:bookroom-schema" targetNamespace="urn:bookstore-schema"

xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="book" type="xs:string" />

  <xs:complexType name="booktype">
    <xs:sequence>
      <xs:element name="author" type="xs:string" />
      <xs:element name="title" type="xs:string" />
      <xs:element name="price" type="xs:decimal" />
    </xs:sequence>
  </xs:complexType>`

  <xs:element name="publisher" type="xs:string" />
</xs:schema>
当我运行程序时,我得到:

book
publisher    
我如何得到这个(所有元素包括子元素)


请指导我如何在德尔福做这件事。提前感谢。

您还必须为
oSchema.types
编写一个循环,因为
booktype
显然是一个类型(或者确切地说是
complexType
),而不是和元素

book
publisher    
book
author
title
price
publisher