XSD - <qualquer>

<qualquer> elemento é usado para estender a funcionalidade XSD. Ele é usado para estender um elemento complexType definido em um XSD por um elemento que não está definido no esquema.

Considere um exemplo - person.xsd definiu personelemento complexType. address.xsd definiuaddress elemento complexType.

person.xsd

<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema"
   targetNamespace = "http://www.tutorialspoint.com"
   xmlns = "http://www.tutorialspoint.com"
   elementFormDefault = "qualified">
   
   <xs:element name = "person">
      <xs:complexType >
         <xs:sequence>
            <xs:element name = "firstname" type = "xs:string"/>
            <xs:element name = "lastname" type = "xs:string"/>
            <xs:element name = "nickname" type = "xs:string"/>     
         </xs:sequence>
      </xs:complexType>
   </xs:element>
	
</xs:schema>

address.xsd

<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema"
   targetNamespace = "http://www.tutorialspoint.com"
   xmlns = "http://www.tutorialspoint.com"
   elementFormDefault = "qualified">
   
   <xs:element name = "address">
      <xs:complexType>
         <xs:sequence>
            <xs:element name = "houseNumber" type = "xs:string"/>
            <xs:element name = "street" type = "xs:string"/>
            <xs:element name = "state" type = "xs:string"/>    
            <xs:element name = "zipcode" type = "xs:integer"/>   	  
         </xs:sequence>
      </xs:complexType>
   </xs:element>

</xs:schema>

Se quisermos definir uma pessoa com endereço em XML, a seguinte declaração será inválida.

person.xml

<?xml version = "1.0"?>
<class xmlns = "http://www.tutorialspoint.com"
   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation = "http://www.tutorialspoint.com person.xsd
   http://www.tutorialspoint.com address.xsd">  

   <person>
      <firstname>Dinkar</firstname>
      <lastname>Kad</lastname>
      <nickname>Dinkar</lastname>
   
      <address>
         <houseNumber>101</firstname>
         <street>Sector-1,Patiala</lastname>
         <state>Punjab</lastname>
         <zipcode>301202<zipcode>
      </address>
   
   </person>
	
</class>

Use <xs: any>

Para validar o person.xml acima, adicione <xs: any> ao elemento person em person.xsd.

person.xsd

<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema"
   targetNamespace = "http://www.tutorialspoint.com"
   xmlns = "http://www.tutorialspoint.com"
   elementFormDefault = "qualified">

   <xs:element name = "person">
      <xs:complexType >
         <xs:sequence>
            <xs:element name = "firstname" type = "xs:string"/>
            <xs:element name = "lastname" type = "xs:string"/>
            <xs:element name = "nickname" type = "xs:string"/>   
            <xs:any minOccurs = "0"/>		 
         </xs:sequence>
      </xs:complexType>
   </xs:element>
	
</xs:schema>

Agora, person.xml será validado em relação a person.xsd e address.xsd.