mirror of
https://gitlab.com/tutorial-java-rafa-munoz/tutorial-java-2024-25/LMSGI-2024-25.git
synced 2025-11-09 18:03:06 +01:00
feat(ch 4): added
This commit is contained in:
5
Unidad_04_DTD_XSD/XSD/xml-xsd-01.xml
Normal file
5
Unidad_04_DTD_XSD/XSD/xml-xsd-01.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<marvel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-01.xsd">
|
||||
un montón de superhéroes
|
||||
</marvel>
|
||||
4
Unidad_04_DTD_XSD/XSD/xml-xsd-01.xsd
Normal file
4
Unidad_04_DTD_XSD/XSD/xml-xsd-01.xsd
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="marvel" />
|
||||
</xs:schema>
|
||||
3
Unidad_04_DTD_XSD/XSD/xml-xsd-02.xml
Normal file
3
Unidad_04_DTD_XSD/XSD/xml-xsd-02.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<marvel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-02.xsd">un montón de superhéroes</marvel>
|
||||
5
Unidad_04_DTD_XSD/XSD/xml-xsd-02.xsd
Normal file
5
Unidad_04_DTD_XSD/XSD/xml-xsd-02.xsd
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="marvel" type="xs:string"
|
||||
fixed="un montón de superhéroes" />
|
||||
</xs:schema>
|
||||
3
Unidad_04_DTD_XSD/XSD/xml-xsd-03.xml
Normal file
3
Unidad_04_DTD_XSD/XSD/xml-xsd-03.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-03.xsd" nombre="Hulk" edad="46"/>
|
||||
12
Unidad_04_DTD_XSD/XSD/xml-xsd-03.xsd
Normal file
12
Unidad_04_DTD_XSD/XSD/xml-xsd-03.xsd
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe" type="tipoComplejo">
|
||||
</xs:element>
|
||||
|
||||
|
||||
<xs:complexType name="tipoComplejo">
|
||||
<xs:attribute name="nombre" type="xs:string" use="required"/>
|
||||
<xs:attribute name="edad" type="xs:integer" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
||||
3
Unidad_04_DTD_XSD/XSD/xml-xsd-04.xml
Normal file
3
Unidad_04_DTD_XSD/XSD/xml-xsd-04.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-04.xsd">Hulk</superheroe>
|
||||
10
Unidad_04_DTD_XSD/XSD/xml-xsd-04.xsd
Normal file
10
Unidad_04_DTD_XSD/XSD/xml-xsd-04.xsd
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe" type="nombreSuperheroe"/>
|
||||
|
||||
<xs:simpleType name="nombreSuperheroe">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="1" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
3
Unidad_04_DTD_XSD/XSD/xml-xsd-05-exp-reg.xml
Normal file
3
Unidad_04_DTD_XSD/XSD/xml-xsd-05-exp-reg.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-05-exp-reg.xsd">rafa@rafa.com</superheroe>
|
||||
10
Unidad_04_DTD_XSD/XSD/xml-xsd-05-exp-reg.xsd
Normal file
10
Unidad_04_DTD_XSD/XSD/xml-xsd-05-exp-reg.xsd
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe" type="nombreSuperheroe"/>
|
||||
|
||||
<xs:simpleType name="nombreSuperheroe">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="\w+@\w+[.]\w+" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
3
Unidad_04_DTD_XSD/XSD/xml-xsd-06-union.xml
Normal file
3
Unidad_04_DTD_XSD/XSD/xml-xsd-06-union.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tallaSuperheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-06-union.xsd">x</tallaSuperheroe>
|
||||
31
Unidad_04_DTD_XSD/XSD/xml-xsd-06-union.xsd
Normal file
31
Unidad_04_DTD_XSD/XSD/xml-xsd-06-union.xsd
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="tallaSuperheroe" type="lista-tallas"/>
|
||||
|
||||
<xs:simpleType name="lista-tallas">
|
||||
<xs:list itemType="talla"/>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="talla">
|
||||
<xs:union memberTypes="talla-texto talla-numero" />
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="talla-texto">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="s" />
|
||||
<xs:enumeration value="m" />
|
||||
<xs:enumeration value="x" />
|
||||
<xs:enumeration value="xl" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
|
||||
<xs:simpleType name="talla-numero">
|
||||
<xs:restriction base="xs:positiveInteger">
|
||||
<xs:enumeration value="38"/>
|
||||
<xs:enumeration value="40"/>
|
||||
<xs:enumeration value="42"/>
|
||||
<xs:enumeration value="44"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
3
Unidad_04_DTD_XSD/XSD/xml-xsd-07-list.xml
Normal file
3
Unidad_04_DTD_XSD/XSD/xml-xsd-07-list.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<numeros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-07-list.xsd">11 23</numeros>
|
||||
16
Unidad_04_DTD_XSD/XSD/xml-xsd-07-list.xsd
Normal file
16
Unidad_04_DTD_XSD/XSD/xml-xsd-07-list.xsd
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="numeros" type="listaNumeros"/>
|
||||
|
||||
<xs:simpleType name="listaNumeros">
|
||||
<xs:list itemType="listaNumerosRestringida" />
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="listaNumerosRestringida">
|
||||
<xs:restriction base="xs:positiveInteger">
|
||||
<xs:minInclusive value="10"/>
|
||||
<xs:maxExclusive value="51"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<NumeroDelimitado xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-08-ejemplo-Derivacion_de_tipos.xsd">51</NumeroDelimitado>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="NumeroDelimitado" type="numero-50-60"/>
|
||||
|
||||
<xs:simpleType name="numero-50-60">
|
||||
<xs:restriction base="numero-10-100">
|
||||
<xs:minInclusive value="50" />
|
||||
<xs:maxInclusive value="60" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="numero-10-100">
|
||||
<xs:restriction base="xs:positiveInteger">
|
||||
<xs:minInclusive value="10"/>
|
||||
<xs:maxInclusive value="100"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
6
Unidad_04_DTD_XSD/XSD/xml-xsd-09-sequence.xml
Normal file
6
Unidad_04_DTD_XSD/XSD/xml-xsd-09-sequence.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-09-sequence.xsd" nombreReal="Bruce Banner">
|
||||
<edad>86</edad>
|
||||
<bando>Buenos</bando>
|
||||
</superheroe>
|
||||
19
Unidad_04_DTD_XSD/XSD/xml-xsd-09-sequence.xsd
Normal file
19
Unidad_04_DTD_XSD/XSD/xml-xsd-09-sequence.xsd
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe" type="caracSuperheroe"/>
|
||||
|
||||
<xs:complexType name="caracSuperheroe">
|
||||
<xs:sequence>
|
||||
<xs:element name="nombre" minOccurs="0" maxOccurs="3" type="minimoUnCaracter" />
|
||||
<xs:element name="edad" type="xs:string" />
|
||||
<xs:element name="bando" type="xs:string" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="nombreReal" type="minimoUnCaracter"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:simpleType name="minimoUnCaracter">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="1"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
7
Unidad_04_DTD_XSD/XSD/xml-xsd-10-choice.xml
Normal file
7
Unidad_04_DTD_XSD/XSD/xml-xsd-10-choice.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-10-choice.xsd">
|
||||
<nombre>Hulk</nombre>
|
||||
<!-- <edad>86</edad>
|
||||
<bando>Buenos</bando> -->
|
||||
</superheroe>
|
||||
13
Unidad_04_DTD_XSD/XSD/xml-xsd-10-choice.xsd
Normal file
13
Unidad_04_DTD_XSD/XSD/xml-xsd-10-choice.xsd
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe" type="caracSuperheroe"/>
|
||||
|
||||
<xs:complexType name="caracSuperheroe">
|
||||
<xs:choice>
|
||||
<xs:element name="nombre" minOccurs="0" maxOccurs="unbounded" type="xs:string" />
|
||||
<xs:element name="edad" type="xs:string" />
|
||||
<xs:element name="bando" type="xs:string" />
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
||||
7
Unidad_04_DTD_XSD/XSD/xml-xsd-11-all.xml
Normal file
7
Unidad_04_DTD_XSD/XSD/xml-xsd-11-all.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-11-all.xsd">
|
||||
<bando>Buenos</bando>
|
||||
<nombre>Hulk</nombre>
|
||||
<edad>86</edad>
|
||||
</superheroe>
|
||||
13
Unidad_04_DTD_XSD/XSD/xml-xsd-11-all.xsd
Normal file
13
Unidad_04_DTD_XSD/XSD/xml-xsd-11-all.xsd
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe" type="caracSuperheroe"/>
|
||||
|
||||
<xs:complexType name="caracSuperheroe">
|
||||
<xs:all>
|
||||
<xs:element name="nombre" type="xs:string" />
|
||||
<xs:element name="edad" type="xs:string" />
|
||||
<xs:element name="bando" type="xs:string" />
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
||||
3
Unidad_04_DTD_XSD/XSD/xml-xsd-12-elemento-vacio.xml
Normal file
3
Unidad_04_DTD_XSD/XSD/xml-xsd-12-elemento-vacio.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-12-elemento-vacio.xsd"></superheroe>
|
||||
6
Unidad_04_DTD_XSD/XSD/xml-xsd-12-elemento-vacio.xsd
Normal file
6
Unidad_04_DTD_XSD/XSD/xml-xsd-12-elemento-vacio.xsd
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe">
|
||||
<xs:complexType />
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-13-elemento-contenido-texto-y-atributos.xsd"
|
||||
nombre="Hulk" edad="86">Buen superheroe</superheroe>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="nombre" type="xs:string" />
|
||||
<xs:attribute name="edad" type="xs:positiveInteger" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-13-elemento-vacio-con-atributos.xsd"
|
||||
nombre="Hulk" edad="86"></superheroe>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="nombre" type="xs:string" />
|
||||
<xs:attribute name="edad" type="xs:positiveInteger" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-14-elemento-contenido-texto-y-atributos.xsd"
|
||||
nombre="Hulk" edad="86">Buen</superheroe>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe" type="mixtoConValidacion"/>
|
||||
|
||||
<xs:complexType name="mixtoConValidacion">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="minimo4Caracteres">
|
||||
<xs:attribute name="nombre" type="xs:string" />
|
||||
<xs:attribute name="edad" type="xs:positiveInteger" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
|
||||
<xs:simpleType name="minimo4Caracteres">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="4"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="nombre" type="xs:string"/>
|
||||
<xs:element name="amigo" type="amigosSuperheroe" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
|
||||
<xs:complexType name="amigosSuperheroe">
|
||||
<xs:sequence>
|
||||
<xs:element name="amigoDeSuperheroe" type="textoNoVacio"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:simpleType name="textoNoVacio">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="1"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-15-elemento-con-descendientes.xsd">
|
||||
<nombre>Hulk</nombre>
|
||||
<amigo>
|
||||
<amigoDeSuperheroe>Thor</amigoDeSuperheroe>
|
||||
</amigo>
|
||||
<amigo>
|
||||
<amigoDeSuperheroe>Hulk</amigoDeSuperheroe>
|
||||
</amigo>
|
||||
<amigo>
|
||||
<amigoDeSuperheroe>Bulleye</amigoDeSuperheroe>
|
||||
</amigo>
|
||||
</superheroe>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="nombre" type="xs:string"/>
|
||||
<xs:element name="amigo" type="textoNoVacio" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:all>
|
||||
<xs:attribute name="edad" type="textoNoVacio"/>
|
||||
<xs:attribute name="color" type="color"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:simpleType name="textoNoVacio">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="1"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="color">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="rojo"/>
|
||||
<xs:enumeration value="verde"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-16-elemento-atributos-y-descendientes.xsd"
|
||||
edad="86" color="verde">
|
||||
<nombre>Hulk</nombre>
|
||||
<amigo>Thor</amigo>
|
||||
</superheroe>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-17-elemento-contenido-mixto.xsd">
|
||||
Este texto no se podría poner sin especificar contenido mixto
|
||||
<!-- <nombre>Hulk</nombre> -->
|
||||
<amigo>Thor</amigo>
|
||||
<amigo>Iron Man</amigo>
|
||||
<amigo>Bulleye</amigo>
|
||||
</superheroe>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:choice>
|
||||
<xs:element name="nombre" type="xs:string"/>
|
||||
<xs:element name="amigo" type="textoNoVacio" minOccurs="2" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:simpleType name="textoNoVacio">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="1"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-18-elemento-con-atributos-y-contenido-mixto.xsd"
|
||||
edad="86" color="verde">Este texto no se podría poner sin especificar contenido mixto
|
||||
<!-- <nombre>Hulk</nombre> -->
|
||||
<amigo>Thor</amigo>
|
||||
<amigo>Iron Man</amigo>
|
||||
<amigo>Bulleye</amigo>
|
||||
</superheroe>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:choice>
|
||||
<xs:element name="nombre" type="xs:string"/>
|
||||
<xs:element name="amigo" type="xs:string" minOccurs="2" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
<xs:attribute name="edad" type="xs:string"/>
|
||||
<xs:attribute name="color" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<superheroe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="xml-xsd-19-derivacion-tipos-complejos.xsd"
|
||||
edad="86" color="verde">
|
||||
Este texto no se podría poner sin especificar contenido mixto
|
||||
<nombre>Hulk</nombre>
|
||||
<amigo>Thor</amigo>
|
||||
<poderPrincipal>Fuerza</poderPrincipal>
|
||||
</superheroe>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="superheroe" type="superheroeDerivado">
|
||||
</xs:element>
|
||||
|
||||
<xs:complexType mixed="true" name="superheroePrimitivo">
|
||||
<xs:sequence>
|
||||
<xs:element name="nombre" type="xs:string"/>
|
||||
<xs:element name="amigo" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="superheroeDerivado">
|
||||
<xs:complexContent mixed="true">
|
||||
<xs:extension base="superheroePrimitivo">
|
||||
<xs:sequence>
|
||||
<xs:element name="poderPrincipal" type="xs:string" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="edad" type="xs:string"/>
|
||||
<xs:attribute name="color" type="xs:string"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
||||
Reference in New Issue
Block a user