1
나는 특정 솔루션을 위해 xsd를 대체 할 임무가 주어졌다. 그러나, 나는 "요소가이 문맥에서 지원되지 않습니다."이전 XSD를 새 것으로 바꾼다
<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>
스키마가 다른 사람에 의해 만들어진 그리고 난 그냥 있어야했다 :
여기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>";
은 내가으로 대체 할 수 있겠 것입니다 : 여기
원래 XSD입니다 그것을 대체 할 수있다. 불행히도 그 방법을 밖으로 작동하지 않으며 그것에 대해 거의 알지 못합니다.나는
<xs:element name='MonthlyValues> and keep the
<xs:sequence>
<xs:element maxOccurs='unbounded' name='MonthlyValues'>
<xs:complexType>
에
<MonthlyValues>
을 변경하고 이후에
<MonthlyValue IndicatorName='name' LocationName='name' GroupingName='name' Year='MonthNum.Value.Year' Month='MonthNum.Value.Month' Numerator='Numerator' Budget='Budget'>
</MonthlyValue>
를 추가해야합니까? 실제로, 나는 그것을 시도하고 그것이 효과가 없지만, 내가해야 할 비슷한 것이 있는가?
가르다 도와 주셔서 감사합니다. 나는 내가 생각했던 것보다 가까이에 있었다. 적어도 나는 바른 길을 가고 있었다! –