Good day! There is an xml file with a trace. content:
<?xml version='1.0' encoding='UTF-8'?> <packet timestamp='2012-02-13 12:50:11.269146' id='97b20aee-5606-11e1-a55c-0050fc9bb1bb'> <opensession> ... </opensession> </packet>
But the <packet>
element can contain either an embedded <opensession>
element or a <closesession>
.
Tell me, please, how to describe it in XML Schema?
At the moment there is a valid.xsd trace. content:
<?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="packet" type="PacketType"/> <xsd:complexType name="PacketType"> <xsd:attribute name="timestamp" type="xsd:date"/> <xsd:attribute name="id" type="xsd:string"/> </xsd:complexType> </xsd:schema>
Thank.