我的任务是为特定解决方案替换 xsd。但是,我不断收到“在这种情况下不支持元素”。
这是原始的xsd:
public const string Xsd = @"
<xs:schema attributeFormDefault='unqualified' elementFormDefault='qualified' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='DataRow'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' name='Data'>
<xs:complexType>
<xs:attribute name='Site' type='xs:string' use='required' />
<xs:attribute name='Month_Num' type='xs:unsignedShort' use='required' />
<xs:attribute name='Numerator' type='xs:unsignedByte' use='required' />
<xs:attribute name='Data_Indicator' type='xs:string' use='required' />
<xs:attribute name='Budgeted' type='xs:unsignedByte' use='required' />
<xs:attribute name='Executive_Comments' type='xs:string' use='required' />
<xs:attribute name='Fleet_Executive_Comments' type='xs:string' use='required' />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>";
这是我应该用以下内容替换它的内容:
<xs:schema attributeFormDefault='unqualified' elementFormDefault='qualified' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<MonthlyValues>
<MonthlyValue IndicatorName='name' LocationName='name' GroupingName='name' Year='MonthNum.Value.Year' Month='MonthNum.Value.Month' Numerator='Numerator' Budget='Budget'>
</MonthlyValue>
</MonthlyValues>
</xs:schema>
该架构是由其他人制作的,我应该能够替换它。不幸的是,它不是那样工作的,我对此知之甚少。
我应该改变吗
<MonthlyValues>
到
<xs:element name='MonthlyValues> and keep the
<xs:sequence>
<xs:element maxOccurs='unbounded' name='MonthlyValues'>
<xs:complexType>
并添加
<MonthlyValue IndicatorName='name' LocationName='name' GroupingName='name' Year='MonthNum.Value.Year' Month='MonthNum.Value.Month' Numerator='Numerator' Budget='Budget'>
</MonthlyValue>
之后?实际上,我试过了,但没有用,但是我有类似的事情要做吗?