Hello!
XML:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<ac code="B2" auto="1">
<fee>
<if country="RU">35e 50e 50e 80e 15e 10e</if>
<else>10e</else>
</fee>
<comission>
<if country="RU">3%</if>
<else>5%</else>
</comission>
</ac>
</data>
Schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="data" type="data"/>
<xs:complexType name="data">
<xs:sequence>
<xs:element name="ac" minOccurs="0" maxOccurs="unbounded" type="ac"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ac">
<xs:sequence>
<xs:element name="fee" type="feecomiss"/>
<xs:element name="comission" type="feecomiss"/>
</xs:sequence>
<xs:attribute name="code" type="xs:string"/>
<xs:attribute name="auto" type="xs:decimal"/>
</xs:complexType>
<xs:complexType name="feecomiss">
<xs:sequence>
<xs:element name="if" minOccurs="0" maxOccurs="unbounded" type="if"/>
<xs:element name="else" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="if">
<xs:attribute name="country" type="xs:string" />
</xs:complexType>
</xs:schema>
This scheme does not validate: (
But if i insert an element inside "if" in xml
<if country="RU"><lol>35e 50e 50e 80e 15e 10e</lol></if>
and fix schema
<xs:complexType name="if">
<xs:sequence>
<xs:element name="lol" type="xs:string"/>
</xs:sequence>
<xs:attribute name="country" type="xs:string" />
</xs:complexType>
That code is valid
How can I fix this?thank you!!! Sorry for bad english