<!--
===============================
Lenguajes de Marcas
Bloque 6, Actividad 6
Alumno: Miguel I. García López.
===============================
= SCHEMA PARA TABLAS =
= CUENTAS Y APUNTES =
===============================
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- TipoImporte: Importe con 2 decimales (float) -->
<xsd:simpleType name="TipoImporte">
<xsd:restriction base="xsd:decimal">
<xsd:fractionDigits value="2" />
</xsd:restriction>
</xsd:simpleType>
<!-- TipoIban (nº de cuenta bancaria según norma IBAN) -->
<xsd:simpleType name="TipoIban">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z]{2}\d{2}([A-Z]||\d){1,30}" />
</xsd:restriction>
</xsd:simpleType>
<!-- TipoNIF: 8 dígitos decimales + letra mayúscula -->
<xsd:simpleType name="TipoNIF">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{8}[A-Z]" />
</xsd:restriction>
</xsd:simpleType>
<!-- TipoConcepto: Conceptos disponibles para los apuntes -->
<xsd:simpleType name="TipoConcepto">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Ingreso efectivo" />
<xsd:enumeration value="Reintegro efectivo" />
<xsd:enumeration value="Ingreso cheque" />
<xsd:enumeration value="Gastos bancarios" />
</xsd:restriction>
</xsd:simpleType>
<!-- TipoApunte: Fecha, Concepto, Importe y atributo Numero -->
<xsd:complexType name="TipoApunte">
<xsd:sequence>
<xsd:element name="fecha" type="xsd:date" />
<xsd:element name="concepto" type="TipoConcepto" />
<xsd:element name="importe" type="TipoImporte" />
</xsd:sequence>
<xsd:attribute name="numero" type="xsd:positiveInteger" />
</xsd:complexType>
<xsd:element name="cuentas">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="cuenta" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="fecha_apertura" type="xsd:date" />
<xsd:element name="titulares">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="titular" type="TipoNIF" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="apuntes">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="apunte" type="TipoApunte" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="iban" type="TipoIban" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
--------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!--
===============================
Lenguajes de Marcas
Bloque 6, Actividad 6
Alumno: Miguel I. García López.
===============================
= TABLAS CUENTAS Y APUNTES =
= CON SCHEMA =
===============================
-->
<cuentas xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
xsd:noNamespaceSchemaLocation="cuentas.xsd">
<cuenta iban="ES33123123123">
<fecha_apertura>2013-10-24</fecha_apertura>
<titulares>
<titular>83709245Y</titular>
<titular>83845902R</titular>
</titulares>
<apuntes>
<apunte numero="1">
<fecha>2013-10-24</fecha>
<concepto>Ingreso efectivo</concepto>
<importe>100.00</importe>
</apunte>
<apunte numero="2">
<fecha>2013-10-26</fecha>
<concepto>Reintegro efectivo</concepto>
<importe>-10.00</importe>
</apunte>
<apunte numero="3">
<fecha>2013-11-01</fecha>
<concepto>Reintegro efectivo</concepto>
<importe>-35.00</importe>
</apunte>
<apunte numero="4">
<fecha>2013-12-04</fecha>
<concepto>Ingreso cheque</concepto>
<importe>550.00</importe>
</apunte>
<apunte numero="5">
<fecha>2014-01-04</fecha>
<concepto>Gastos bancarios</concepto>
<importe>-5.00</importe>
</apunte>
</apuntes>
</cuenta>
<cuenta iban="ES4455764598766">
<fecha_apertura>2014-01-25</fecha_apertura>
<titulares>
<titular>83745090T</titular>
</titulares>
<apuntes>
<apunte numero="1">
<fecha>2014-01-25</fecha>
<concepto>Ingreso efectivo</concepto>
<importe>500.00</importe>
</apunte>
<apunte numero="2">
<fecha>2014-02-15</fecha>
<concepto>Ingreso efectivo</concepto>
<importe>50.00</importe>
</apunte>
</apuntes>
</cuenta>
<cuenta iban="ES949586746725">
<fecha_apertura>2014-04-03</fecha_apertura>
<titulares>
<titular>83764592X</titular>
</titulares>
<apuntes>
<apunte numero="1">
<fecha>2014-04-03</fecha>
<concepto>Ingreso cheque</concepto>
<importe>350.00</importe>
</apunte>
</apuntes>
</cuenta>
<cuenta iban="ES948576543231">
<fecha_apertura>2012-11-01</fecha_apertura>
<titulares>
<titular>98934059J</titular>
<titular>83845902R</titular>
</titulares>
<apuntes>
<apunte numero="1">
<fecha>2012-11-01</fecha>
<concepto>Ingreso efectivo</concepto>
<importe>75.00</importe>
</apunte>
<apunte numero="2">
<fecha>2013-09-05</fecha>
<concepto>Gastos bancarios</concepto>
<importe>-5.00</importe>
</apunte>
</apuntes>
</cuenta>
<cuenta iban="ES444555666782">
<fecha_apertura>2010-01-02</fecha_apertura>
<titulares>
<titular>83709245Y</titular>
<titular>28376350S</titular>
</titulares>
<apuntes>
<apunte numero="1">
<fecha>2010-01-02</fecha>
<concepto>Ingreso cheque</concepto>
<importe>458.00</importe>
</apunte>
<apunte numero="2">
<fecha>2011-05-04</fecha>
<concepto>Reintegro efectivo</concepto>
<importe>-35.00</importe>
</apunte>
<apunte numero="3">
<fecha>2011-07-15</fecha>
<concepto>Ingreso efectivo</concepto>
<importe>123.00</importe>
</apunte>
</apuntes>
</cuenta>
</cuentas>
No hay comentarios:
Publicar un comentario