contentmodel에서 partilces에 액세스 할 때 '매개 변수가 잘못되었습니다.'가 표시되지만 itemtype을 읽는 것이 좋습니다. 누군가 나에게 무엇을해야한다고 말할 수 있습니까? 미리 감사드립니다.delphi를 사용하여 msxml6에서 complextype의 입자에 액세스하는 방법?
//Book.xsd
<xs:schema xmlns="urn:bookstore-schema" targetNamespace="urn:bookstore-schema"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="book" type="booktype" />
<xs:complexType name="booktype">
<xs:sequence>
<xs:element name="author" type="xs:string" />
<xs:element name="price" type="xs:decimal" />
<xs:element name="aaa" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="another" type="xs:string" />
procedure AccessSchema;
var oSchemaCache : XMLSchemaCache60;
oSchema : ISchema;
nsTarget : string;
kk : integer;
procedure AccessComplexType(oComplex : iSchemaItem);
var ISchComplex : ISchemaComplexType;
begin
ISchComplex := oComplex as ISchemaComplexType;
if (iSchComplex.contentType = SCHEMACONTENTTYPE_MIXED) or
(iSchComplex.contentType = SCHEMACONTENTTYPE_ELEMENTONLY) then
begin
if (iSchComplex.contentModel.ItemType = SOMITEM_CHOICE) or
(iSchComplex.contentModel.ItemType = SOMITEM_SEQUENCE) then
begin
if IschComplex.contentModel.particles.length > 0 then
//error : the parameter is incorrect
begin
{handling particles }
end;
end;
end;
end;
begin
oSchemaCache := coXMLSchemaCache60.Create;
nsTarget := 'urn:bookstore-schema';
oSchemaCache.add(nsTarget,'c:\book.xsd');
oSchema := oSchemaCache.getSchema(nsTarget);
for kk := 0 to pred(oschema.types.length) do
begin
if (oschema.types.item[kk].itemType = SOMITEM_COMPLEXTYPE) then
AccessComplexType(oschema.types.item[kk]);
end;
단부;