Panteras Logo
English
Loading Loading...
A A A

Comunicación, Panteras UP

What's XML?

XML (Extensible Markup Language) is a simple, very flexible text format derived from SGML (ISO 8879). Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere. What we do is:

  1. Create an XML with the information we want as if it was a tree, for examle:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <links>
     <tag>
      <nombre>team-students.xml</nombre>
      <comentarios>XML for all the students</comentarios>
     </tag>
     <tag>
      <nombre>team-coaches.xml</nombre>
      <comentarios>XML for all the coaches</comentarios>
     </tag>
     <tag>
      <nombre>team-mentors.xml</nombre>
      <comentarios>XML for all the mentors</comentarios>
     </tag>
    </links>
  2. Then we read the XML code with a script.
  3. So, we have now the code loaded so another script takes the code and writes it into the HTML by using a DIV with a specific ID.
  4. By having the HTML code generated, what we do is that we put the style on by using a CSS and giving each part of the script an specific Class.

Panteras XML's

You browser must support XML without stylesheets in order to see this codes
We recomend browsers like Firefox 3.6.3+ or Opera 10.5+

In fact...

By usig this method, we create smaller files and we can modify easily the templates instead of changig lots of code. This is why instead of making:

<a href="2011Resources/scripts/XML/team-students.xml"><table class="studentContainer" id="students"><tr><td><img class="studentCover" src="2011Resources/images/graphics/xml.jpg" alt=" "></td><td><h3>team-students.xml</h3><br />XML for all the students</td></tr></table></a>
<a href="2011Resources/scripts/XML/team-coaches.xml"><table class="studentContainer" id="coaches"><tr><td><img class="studentCover" src="2011Resources/images/graphics/xml.jpg" alt=" "></td><td><h3>team-coaches.xml</h3><br />XML for all the coaches</td></tr></table></a>
<a href="2011Resources/scripts/XML/team-mentores.xml"><table class="studentContainer" id="mentors"><tr><td><img class="studentCover" src="2011Resources/images/graphics/xml.jpg" alt=" "></td><td><h3>team-mentores.xml</h3><br />XML for all the mentors</td></tr></table></a>

We just tell the script to read and write:

$('<a href="2011Resources/scripts/XML/'+url+'"></a>').html('<table class="studentContainer'+ sOdd +'" id="'+ id +'"><tr><td><img class="studentCover" src="2011Resources/images/graphics/' + imagen +'.jpg" alt=" "></td><td><h3>'+url+'</h3><br />'+comentario+'</td></tr></table>').appendTo('#XMLS');

This tells the script to read the XML and for each link, create a table and write it on the DIV with the ID XMLS

If you want some help with this, you can visit http://www.w3.org/XML/ or just contact us!

We want to thank: Omar Guerrero from Teléfonos de México S.A.B. de C.V.® (TELMEX®) for the support on the XML coding.




Sponsors
Panteras Logo