UT4.2 Correo Electronico

Correo Electronico
XML Correo Electronico
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mail SYSTEM "01.dtd">


<mail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="01.xsd">
  <remitente>
    juanmdom@yahoo.com
  </remitente>
  <destinatarios>
    <destinatario> amor@hotmail.com</destinatario>
    <destinatario> claudio@eracl.io</destinatario>
  </destinatarios>
  <fecha>
    <dia> ---17</dia>
    <mes> --02 </mes>
    <anio> 2017</anio>
  </fecha>
  <asunto> Cena Navidenaña</asunto>
  <mensaje>
    <h2> Formal Invitacion a Cena Navidenaña</h2>

    <p> querido <strong> compañer@</strong>:</p>

    <p>Estas cordealmente invitado a mi <strong>Cena Navidenaña</strong></p>

    <h3>
      Detalles del evento:
    </h3>
    <ul>
      <li>
        <strong>Fecha:</strong> Manaña
      </li>
      <li>
        <strong>Hora:</strong> por la noche
      </li>
      <li>
        <strong>Lugar:</strong> mi casa
      </li>
    </ul>

    <p> te adjunto un par de cosillas, <strong>Gracias! Chao... cha-cha-cha-chao</strong></p>
  </mensaje>

  <ficherosAdjuntos>
    <fichero>
      <nombre> video_cena.mp4</nombre>
      <tipoMime>video/mp4</tipoMime>
    </fichero>
    <fichero>
      <nombre> foto_mia.png</nombre>
      <tipoMime>image/png</tipoMime>
    </fichero>
  </ficherosAdjuntos>
</mail>
DTD Correo Electronico
<!ELEMENT mail (remitente, destinatarios, fecha,asunto?, mensaje,ficherosAdjuntos?)>
<!ATTLIST mail xmlns:xsi CDATA #REQUIRED
            xsi:noNamespaceSchemaLocation CDATA #REQUIRED>

<!ELEMENT destinatarios (destinatario+)>
<!ELEMENT destinatario (#PCDATA)>

<!ELEMENT fecha (dia, mes, anio)>
<!ELEMENT dia (#PCDATA)>
<!ELEMENT mes (#PCDATA)>
<!ELEMENT anio (#PCDATA)>

<!ELEMENT mensaje ( h2 | h3 | p | ul)*>
<!ELEMENT h2 (#PCDATA)>
<!ELEMENT h3 (#PCDATA)>
<!ELEMENT ul (li+)>
<!ELEMENT li (#PCDATA | strong)*>
<!ELEMENT p (#PCDATA | strong)*>
<!ELEMENT strong (#PCDATA)>

<!ELEMENT ficherosAdjuntos (fichero*)>
<!ELEMENT fichero (nombre, tipoMime)>
<!ELEMENT nombre (#PCDATA)>
<!ELEMENT tipoMime (#PCDATA)>
<!ELEMENT remitente (#PCDATA)>
<!ELEMENT asunto (#PCDATA)>
XSD Correo Electronico
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="mail">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="remitente" type="xs:string"/>
                <xs:element name="destinatarios">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="destinatario" type="xs:string" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="fecha">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="dia" type="xs:gDay"/>
                            <xs:element name="mes" type="xs:gMonth"/>
                            <xs:element name="anio" type="xs:gYear"/>
                            
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <!--                                 Minimo de Occur por default is 1 -->
                <xs:element name="asunto" type="xs:string" minOccurs="0"/>
                <xs:element name="mensaje">
                    <xs:complexType mixed="true">
                        <xs:choice maxOccurs="unbounded" >
                            <xs:element name="h2" type="xs:string" maxOccurs="unbounded" />
                            <xs:element name="h3" type="xs:string" maxOccurs="unbounded" />
                            <xs:element name="p" minOccurs="0">
                                <xs:complexType mixed="true">
                                    <xs:choice>
                                        <xs:element name="strong" type="xs:string" maxOccurs="unbounded"/>
                                    </xs:choice>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="ul" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="li" maxOccurs="unbounded">
                                            <xs:complexType mixed="true">
                                                <xs:choice>
                                                    <xs:element name="strong" type="xs:string" maxOccurs="unbounded"/>
                                                </xs:choice>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:choice>
                    </xs:complexType>
                </xs:element>
                <xs:element name="ficherosAdjuntos" minOccurs="0">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="fichero" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="nombre" type="xs:string"/>
                                        <xs:element name="tipoMime" type="xs:string"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>

                        </xs:sequence>

                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>