XSD custom type with attribute and restriction

前端 未结 1 1686
眼角桃花
眼角桃花 2021-01-20 00:08

I am developing an XSD document to validate XML Import files. Nearly all elements of the import file \'can\' have an ID attribute (UPDATE). The UPDATE attribute must be lim

相关标签:
1条回答
  • 2021-01-20 00:22

    I would think that you could do 20 custom types more (for a total of 40) and then use the appropriate ones (w/ or w/o attribute). In your case:

    <xs:complexType name="MyChar50Attr"><!-- This one has attributes -->
        <xs:simpleContent>
            <xs:extension base="MyChar50">
                <xs:attribute name="UPDATE" type="MyUpDir"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    <xs:element name="FullName" type="MyChar50Attr"/>
    
    0 讨论(0)
提交回复
热议问题