XML is the syntax tags base, which is the same as the html tag-based syntax.
xml is the basis of xhtml, web services, etc..
XML is used because the xml is universal and can be easily understood.
because of its universal xml which allows us to transfer data between two different systems.
for example if we want to make a search enggine by sending a message to the google xml. and google will send the results in the form of xml. Depends on us how to process the xml file. (www.google.com / api)
advantages of xml:
- Presentation layer and data layer separately. Making it easier for us if you want to make a change.
- Can be converted to some other files such as html, pdf, etc..
- Simply make a change in the data within the xml.
disadvantages:
- For which the data are not as efficient as sql. So better not a big store data in xml form.
Here is a small example of the use of xml with php and asp.net
xmlfile.xml ===================== ========================== ==================
================================================== =======================
test.php ===================== ========================== ====================
================================================== =======================
test.aspx ==================== =========================== ====================
using System.Xml;
.
.
.
string path = Server.MapPath ("xmlfile.xml");
Read = new XmlTextReader XmlTextReader (path);
while (read.Read ())
{
if (read.Name == "user" & read.HasAttributes)
{
Response.Write ("User Id:" read.GetAttribute ("id"));
Response.Write ("
");
}
if (read.Name == "email" & read.HasAttributes)
{
Response.Write ("Email Address:" read.GetAttribute ("address"));
Response.Write ("
");
Response.Write ("
");
}
}
.
.
.
================================================== =======================
Sorry if there are errors or there is a lack of writing code.Thanks
xml is the basis of xhtml, web services, etc..
XML is used because the xml is universal and can be easily understood.
because of its universal xml which allows us to transfer data between two different systems.
for example if we want to make a search enggine by sending a message to the google xml. and google will send the results in the form of xml. Depends on us how to process the xml file. (www.google.com / api)
advantages of xml:
- Presentation layer and data layer separately. Making it easier for us if you want to make a change.
- Can be converted to some other files such as html, pdf, etc..
- Simply make a change in the data within the xml.
disadvantages:
- For which the data are not as efficient as sql. So better not a big store data in xml form.
Here is a small example of the use of xml with php and asp.net
xmlfile.xml ===================== ========================== ==================
================================================== =======================
test.php ===================== ========================== ====================
================================================== =======================
test.aspx ==================== =========================== ====================
using System.Xml;
.
.
.
string path = Server.MapPath ("xmlfile.xml");
Read = new XmlTextReader XmlTextReader (path);
while (read.Read ())
{
if (read.Name == "user" & read.HasAttributes)
{
Response.Write ("User Id:" read.GetAttribute ("id"));
Response.Write ("
");
}
if (read.Name == "email" & read.HasAttributes)
{
Response.Write ("Email Address:" read.GetAttribute ("address"));
Response.Write ("
");
Response.Write ("
");
}
}
.
.
.
================================================== =======================
Sorry if there are errors or there is a lack of writing code.Thanks