Welcome visitor
* Login
* Register
It is currently May 25th, 2019, 9:14 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 7 posts ] 

Add this to tutorials?
Poll ended at November 1st, 2009, 7:36 pm
Yes 100%  100%  [ 9 ]
No 0%  0%  [ 0 ]
I don't really care 0%  0%  [ 0 ]
Total votes : 9
Author Message
  What is XML?
PostPosted: October 27th, 2009, 5:43 pm 

Posts: 23
What is an xml file and how is it related to html sites? How could I use them? Im learning different technologies that could help me on my new site. Thanks for your posts.


Top
 Profile  
 
  Re: What is XML?
PostPosted: October 27th, 2009, 7:14 pm 
Site Admin
User avatar

Posts: 39
XML is a widespread notation standard made, basically, to share tables of information between different languages and applications using a simple text file.

For instance, imagine you have a table made in Excel—or any other similar application—named CHILDREN:
----------------------------
|  ID  |  NAME  |   AGE    |
----------------------------
|  1   |  John  |   Five   |
----------------------------
|  2   |  Peter |   Four   |
----------------------------
|  3   |  Mary  |   Seven  |
----------------------------

and you want to export it to a database like Oracle, or to a PHP script, or to a FLASH application, etc. You need to create a standard format readable by all those different platforms. That standard is XML.

XML works with tags and parameters, just like HTML. The difference is that in XML you can make up your own tag names as you need them.
Look at the different ways of writing the table above using XML.


Using only tags, without parameters:
<?xml version="1.0" ?>

<children>

  <child>
    <id>1</id>
    <name>John</name>
    <age>Five</age>
  </child>

  <child>
    <id>2</id>
    <name>Peter</name>
    <age>Four</age>
  </child>

  <child>
    <id>3</id>
    <name>Mary</name>
    <age>Seven</age>
  </child>

</children>


Using tags and a few parameters:
<?xml version="1.0" ?>

<children>

  <child id="1">
    <name>John</name>
    <age>Five</age>
  </child>
   
  <child id="2">
    <name>Peter</name>
    <age>Four</age>
  </child>
 
  <child id="2">
    <name>Mary</name>
    <age>Seven</age>
  </child>
 
</children>

Here I am using the parameter id inside each <child> tag to store the child's ID. The Name and Age are still stored within their own tags.


Using tags and more parameters:
<?xml version="1.0" ?>

<children>

  <child id="1" name="John" age="Five" />
   
  <child id="2" name="Peter" age="Four" />
 
  <child id="3" name="Mary" age="Seven" />
 
</children>

Notice how, in this last example, since I am using parameters in the <child> tags to store all my information—instead of adding more tags within—I can add a self-closing slash at the end of each <child> instance.


Which method is the best one? Well, that's really up to you. Combine tags and parameters and see what best suits your needs.

By using XML you can easily store and exchange tables of information between multiple platforms.

Regarding its relationship with HTML, XHTML (the today's de-facto standard for HTML) allows XML markup inside the same HTML file. That is where the X comes from.

_________________
I'm not afraid to die. I just don't want to be there when it happens.
- Woody Allen


Top
 Profile  
 
  Re: What is XML?
PostPosted: October 27th, 2009, 7:31 pm 
User avatar

Posts: 61
Good explanation! ;)


Top
 Profile  
 
  Re: What is XML?
PostPosted: October 27th, 2009, 7:34 pm 
User avatar

Posts: 21
You should add this to the tutorials section

_________________
IT. Consulting
www.tnogos.com


Top
 Profile  
 
  Re: What is XML?
PostPosted: October 27th, 2009, 7:46 pm 

Posts: 16
Nice forum! Nice explanation! :mrgreen:


Top
 Profile  
 
  Re: What is XML?
PostPosted: October 27th, 2009, 10:52 pm 
User avatar

Posts: 136
Basically XML is a language that lets you organize data in a structured way. Because you use data for your website content you can use XML capabilities as a kind of database or the source content for a table, although you will need more than HTML to parse it. Most likely you will find feeds on websites, they work based on XML language.


Top
 Profile  
 
  Re: What is XML?
PostPosted: October 29th, 2009, 7:34 pm 

Posts: 22
Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron