xml - Xsd Element SimpleType plus attributes -
I am not able to express the following with Xsd: a simple type restriction (calculation of values) and on this element A feature is required. For example:
& lt; MyElement some_id_value = "1" & gt; Sepels & lt; / MyElement & gt;
Where the simplest type is defined:
& lt; X: Simple Type Name = "Simple Type_Fruv" & gt; & Lt; Xs: restriction base = "xs: string" & gt; & Lt; Xs: calculation value = "apple" /> & Lt; Xs: calculation value = "banana" /> & Lt; Xs: calculation value = "orange" /> & Lt; / XS: Ban & gt; & Lt; / XS: simpltype & gt;
My element is defined as now:
& lt; Xs: element name = "myElement" type = "simpleType_Fruit" />
A similar question is asked here, and it can be answered, but I'm not sure (the answer is more than just one)
You can use element declaration as your "simple type-firm" base type and the necessary properties With one can expand. / P>
& lt; Xs: element name = "myElement" & gt; & Lt; XS: complexType & gt; & Lt; XS: simpleContent & gt; & Lt; Xs: extension base = "simple type-foot" & gt; & Lt; Xs: attribute name = "some_id_value" type = "xs: byte" /> & Lt; / XS: Expansion & gt; & Lt; / XS: simpleContent & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt; & Lt; Xs: simple type name = "simple type-firm" & gt; & Lt; Xs: restriction base = "xs: string" & gt; & Lt; Xs: calculation value = "apple" /> & Lt; Xs: calculation value = "banana" /> & Lt; Xs: calculation value = "orange" /> & Lt; / XS: Ban & gt; & Lt; / XS: simpleType & gt;
Comments
Post a Comment