XML:
         Ejemplos de uso

         Sergio Luján Mora
         sergio.lujan@ua.es
XML-02
Vídeo de esta presentación
    Puedes ver esta presentación en vídeo:

http://www.youtube.com/watch?v=-7HttBJnk9g
XHTML
Aplicación XML
Aplicación no significa un programa
que utilice XML.

Aplicación significa el uso de XML
para un dominio específico.
Aplicación XML
          =
Lenguaje de marcado
          =
    Vocabulario
DocBook
Chemical Markup Language
Keyhole Markup Language
Mathematical Markup Language
Open Document
Open XML Format
Scalable Vector Graphics
Systems Byology Markup Language
Chemical Markup Language
•   Estructura química de moléculas
•   Reacciones químicas
•   Información de espectros y análisis
•   Datos de química computacional
•   Datos cristalografía y materiales
<?xml version="1.0" ?>
<cml xmlns="http://www.xml-cml.org/schema/cml2/core"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-
   instance"
        xsi:schemaLocation="http://www.xml-
   cml.org/schema/cml2/core/cmlCore.xsd">
<molecule title="Water">
   <atomArray>
        <atom id="a1" elementType="H" hydrogenCount="0" />
        <atom id="a2" elementType="O" hydrogenCount="2" />
        <atom id="a3" elementType="H" hydrogenCount="0" />
   </atomArray>
   <bondArray>
        <bond atomRefs2="a1 a2" order="1" />
        <bond atomRefs2="a2 a3" order="1" />
   </bondArray>
</molecule>
</cml>
<?xml version="1.0" standalone="no"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
       "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book lang="es" id="simple_libro">
      <title>Un libro muy simple</title>

      <chapter id="capitulo_1">
           <title>Capitulo 1</title>
           <para>Hola mundo!</para>
           <para>¡Yo espero que tu día sea bueno!</para>
      </chapter>

       <chapter id="capitulo_2">
            <title>Capitulo 2</title>
            <para>Hola otra vez, mundo!</para>
       </chapter>
</book>
<?xml version="1.0" standalone="no"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
       "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<article lang="es">
      <title>Creando Documentación Técnica con DocBook</title>
      <articleinfo>
        <author>
           <firstname>Leonardo</firstname>
           <surname>Caballero</surname>
        </author>
      </articleinfo>
      <section id="art-intro">
        <title>Introducción</title>
        <para>DocBook es un aplicación del estándar SGML/XML e incluye
        una DTD propia y que se utiliza de manera más destacada el área
        de la documentación técnica.
        </para>
      </section>
</article>
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
    <name>New York City</name>
    <description>New York City</description>
    <Point>
        <coordinates>-74.006393,40.714172,0</coordinates>
    </Point>
</Placemark>
</Document>
</kml>
Mathematical Markup Language
• XHTML + MathML
• Intercambio de información:
  Maple, Matlab, etc.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE math PUBLIC "-//W3C//DTD
   MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">
<math mode="display" xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>x</mi>
    <mo>=</mo>
    <mfrac>
      <mrow>
         <mo form="prefix">&#x2212;<!-- &minus; --></mo>
         <mi>b</mi>
         <mo>&#x00B1;<!-- &PlusMinus; --></mo>
         <msqrt>
           <msup>
             <mi>b</mi>
             <mn>2</mn>
           </msup>
<mo>&#x2212;<!-- &minus; --></mo>
           <mn>4</mn>
           <mo>&#x2062;<!-- &InvisibleTimes; --></mo>
           <mi>a</mi>
           <mo>&#x2062;<!-- &InvisibleTimes; --></mo>
           <mi>c</mi>
        </msqrt>
      </mrow>
      <mrow>
        <mn>2</mn>
        <mo>&#x2062;<!-- &InvisibleTimes; --></mo>
        <mi>a</mi>
      </mrow>
    </mfrac>
  </mrow>
</math>
http://www.w3.org/Math/XSL/pmathml2.xml
<p>Below you should see an       <mml:msub>
equation inlined within some     <mml:mfenced open="{" close="}">
text</p>                                 <mml:mrow>
                                           <mml:mi>a</mml:mi>
<p>some text, some text,                   <mml:mo>+</mml:mo>
<mml:math>                                 <mml:mi>b</mml:mi>
  <mml:mrow>                             </mml:mrow>
    <mml:msup>                         </mml:mfenced>
<mml:mfenced open="[" close="]">       <mml:mi>i</mml:mi>
        <mml:mrow>                   </mml:msub>
          <mml:mi>a</mml:mi>       </mml:mrow>
          <mml:mo>+</mml:mo>     </mml:math>
          <mml:mi>b</mml:mi>      some text.</p>
        </mml:mrow>
      </mml:mfenced>
      <mml:mn>260</mml:mn>
    </mml:msup>
    <mml:mo>+</mml:mo>
<p>Below is an equation with a radical:</p>

<p>
<mml:math>
  <mml:msup>
    <mml:msqrt>
      <mml:mrow>
        <mml:mi>a</mml:mi>
        <mml:mo>+</mml:mo>
        <mml:mi>b</mml:mi>
      </mml:mrow>
    </mml:msqrt>
    <mml:mn>27</mml:mn>
  </mml:msup>
</mml:math>
</p>
OpenDocument
Office Open XML
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg"
     width="12cm" height="8cm">
  <title>The pink triangle!!!</title>
  <text x="10" y="15">This is SVG!</text>
  <polygon style="fill: pink"
  points="0,311 180,0 360,311" />
</svg>
Systems Biology Markup Language
• Redes metabólicas
• Rutas de señalización celular
• Redes de regulación génicas
<?xml version="1.0" encoding="UTF-8"?>
<sbml level="2" version="3" xmlns="http://www.sbml.org/sbml/level2/version3">
  <model name="EnzymaticReaction">
    <listOfUnitDefinitions>
       <unitDefinition id="per_second">
         <listOfUnits>
            <unit kind="second" exponent="-1"/>
         </listOfUnits>
       </unitDefinition>
       <unitDefinition id="litre_per_mole_per_second">
         <listOfUnits>
            <unit kind="mole" exponent="-1"/>
            <unit kind="litre" exponent="1"/>
            <unit kind="second" exponent="-1"/>
         </listOfUnits>
       </unitDefinition>
    </listOfUnitDefinitions>
    <listOfCompartments>
DocBook
Chemical Markup Language
Keyhole Markup Language
Mathematical Markup Language
Open Document
Open XML Format
Scalable Vector Graphics
Systems Byology Markup Language
Más información:

http://accesibilidadweb.dlsi.ua.es/

 http://desarrolloweb.dlsi.ua.es/

       sergio.lujan@ua.es
Créditos de fotografías e imágenes:
http://www.w3.org/Consortium/Legal/logo-usage-20000308
http://es.wikipedia.org/wiki/Archivo:Newgooglelogo.png
http://www.opengeospatial.org/ogc/policies/logo
http://es.wikipedia.org/wiki/Open_Document
http://thenetworkisthecomputer.com/files/so51_packaging.png
http://en.wikipedia.org/wiki/File:Sun_Microsystems_logo.svg
http://en.wikipedia.org/wiki/File:Oracle_logo.svg
http://www.sxc.hu/photo/1238327
http://en.wikipedia.org/wiki/File:Microsoft_wordmark.svg

XML: Ejemplos de uso

  • 1.
    XML: Ejemplos de uso Sergio Luján Mora sergio.lujan@ua.es XML-02
  • 2.
    Vídeo de estapresentación Puedes ver esta presentación en vídeo: http://www.youtube.com/watch?v=-7HttBJnk9g
  • 5.
  • 6.
  • 7.
    Aplicación no significaun programa que utilice XML. Aplicación significa el uso de XML para un dominio específico.
  • 8.
    Aplicación XML = Lenguaje de marcado = Vocabulario
  • 9.
    DocBook Chemical Markup Language KeyholeMarkup Language Mathematical Markup Language Open Document Open XML Format Scalable Vector Graphics Systems Byology Markup Language
  • 11.
    Chemical Markup Language • Estructura química de moléculas • Reacciones químicas • Información de espectros y análisis • Datos de química computacional • Datos cristalografía y materiales
  • 12.
    <?xml version="1.0" ?> <cmlxmlns="http://www.xml-cml.org/schema/cml2/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xsi:schemaLocation="http://www.xml- cml.org/schema/cml2/core/cmlCore.xsd"> <molecule title="Water"> <atomArray> <atom id="a1" elementType="H" hydrogenCount="0" /> <atom id="a2" elementType="O" hydrogenCount="2" /> <atom id="a3" elementType="H" hydrogenCount="0" /> </atomArray> <bondArray> <bond atomRefs2="a1 a2" order="1" /> <bond atomRefs2="a2 a3" order="1" /> </bondArray> </molecule> </cml>
  • 15.
    <?xml version="1.0" standalone="no"?> <!DOCTYPEbook PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> <book lang="es" id="simple_libro"> <title>Un libro muy simple</title> <chapter id="capitulo_1"> <title>Capitulo 1</title> <para>Hola mundo!</para> <para>¡Yo espero que tu día sea bueno!</para> </chapter> <chapter id="capitulo_2"> <title>Capitulo 2</title> <para>Hola otra vez, mundo!</para> </chapter> </book>
  • 16.
    <?xml version="1.0" standalone="no"?> <!DOCTYPEarticle PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> <article lang="es"> <title>Creando Documentación Técnica con DocBook</title> <articleinfo> <author> <firstname>Leonardo</firstname> <surname>Caballero</surname> </author> </articleinfo> <section id="art-intro"> <title>Introducción</title> <para>DocBook es un aplicación del estándar SGML/XML e incluye una DTD propia y que se utiliza de manera más destacada el área de la documentación técnica. </para> </section> </article>
  • 21.
    <?xml version="1.0" encoding="UTF-8"?> <kmlxmlns="http://www.opengis.net/kml/2.2"> <Document> <Placemark> <name>New York City</name> <description>New York City</description> <Point> <coordinates>-74.006393,40.714172,0</coordinates> </Point> </Placemark> </Document> </kml>
  • 23.
    Mathematical Markup Language •XHTML + MathML • Intercambio de información: Maple, Matlab, etc.
  • 25.
    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"> <math mode="display" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>x</mi> <mo>=</mo> <mfrac> <mrow> <mo form="prefix">&#x2212;<!-- &minus; --></mo> <mi>b</mi> <mo>&#x00B1;<!-- &PlusMinus; --></mo> <msqrt> <msup> <mi>b</mi> <mn>2</mn> </msup>
  • 26.
    <mo>&#x2212;<!-- &minus; --></mo> <mn>4</mn> <mo>&#x2062;<!-- &InvisibleTimes; --></mo> <mi>a</mi> <mo>&#x2062;<!-- &InvisibleTimes; --></mo> <mi>c</mi> </msqrt> </mrow> <mrow> <mn>2</mn> <mo>&#x2062;<!-- &InvisibleTimes; --></mo> <mi>a</mi> </mrow> </mfrac> </mrow> </math>
  • 28.
  • 29.
    <p>Below you shouldsee an <mml:msub> equation inlined within some <mml:mfenced open="{" close="}"> text</p> <mml:mrow> <mml:mi>a</mml:mi> <p>some text, some text, <mml:mo>+</mml:mo> <mml:math> <mml:mi>b</mml:mi> <mml:mrow> </mml:mrow> <mml:msup> </mml:mfenced> <mml:mfenced open="[" close="]"> <mml:mi>i</mml:mi> <mml:mrow> </mml:msub> <mml:mi>a</mml:mi> </mml:mrow> <mml:mo>+</mml:mo> </mml:math> <mml:mi>b</mml:mi> some text.</p> </mml:mrow> </mml:mfenced> <mml:mn>260</mml:mn> </mml:msup> <mml:mo>+</mml:mo>
  • 30.
    <p>Below is anequation with a radical:</p> <p> <mml:math> <mml:msup> <mml:msqrt> <mml:mrow> <mml:mi>a</mml:mi> <mml:mo>+</mml:mo> <mml:mi>b</mml:mi> </mml:mrow> </mml:msqrt> <mml:mn>27</mml:mn> </mml:msup> </mml:math> </p>
  • 35.
  • 44.
  • 53.
    <?xml version="1.0"?> <svg xmlns="http://www.w3.org/2000/svg" width="12cm" height="8cm"> <title>The pink triangle!!!</title> <text x="10" y="15">This is SVG!</text> <polygon style="fill: pink" points="0,311 180,0 360,311" /> </svg>
  • 56.
    Systems Biology MarkupLanguage • Redes metabólicas • Rutas de señalización celular • Redes de regulación génicas
  • 58.
    <?xml version="1.0" encoding="UTF-8"?> <sbmllevel="2" version="3" xmlns="http://www.sbml.org/sbml/level2/version3"> <model name="EnzymaticReaction"> <listOfUnitDefinitions> <unitDefinition id="per_second"> <listOfUnits> <unit kind="second" exponent="-1"/> </listOfUnits> </unitDefinition> <unitDefinition id="litre_per_mole_per_second"> <listOfUnits> <unit kind="mole" exponent="-1"/> <unit kind="litre" exponent="1"/> <unit kind="second" exponent="-1"/> </listOfUnits> </unitDefinition> </listOfUnitDefinitions> <listOfCompartments>
  • 59.
    DocBook Chemical Markup Language KeyholeMarkup Language Mathematical Markup Language Open Document Open XML Format Scalable Vector Graphics Systems Byology Markup Language
  • 60.
  • 62.
    Créditos de fotografíase imágenes: http://www.w3.org/Consortium/Legal/logo-usage-20000308 http://es.wikipedia.org/wiki/Archivo:Newgooglelogo.png http://www.opengeospatial.org/ogc/policies/logo http://es.wikipedia.org/wiki/Open_Document http://thenetworkisthecomputer.com/files/so51_packaging.png http://en.wikipedia.org/wiki/File:Sun_Microsystems_logo.svg http://en.wikipedia.org/wiki/File:Oracle_logo.svg http://www.sxc.hu/photo/1238327 http://en.wikipedia.org/wiki/File:Microsoft_wordmark.svg