In contrast to the popular myth about XML, it's not actually a development language, it is a mark-up language, and as a result, essentially the most least complicated computer language around.
XML is really a non semantic language therefore, you can develop your own element tags and in contrast to other languages there isn't any real complex syntax structures to think about.
Given it isn’t a programming language, XML itself doesn’t really do anything, by design, it’s really a storage container for data and so it only comes up as very simple text on web pages or as a text file.
You can also utilize XML to properly exhibit pages around distinct internet browsers and version types, to do this you have to compose different formatting directions, known as DTD.s or Schemas.
Dealing with XML and building basic files is really rather simple if you can learn the basic principles, below is a glance at 9 of the most well-known XML words that you may run into.
1. XML (Extensible Mark-up Language
As already stated, xml is a markup language that works as a container for the holding of data and allows data and information to be transported and displayed on the online as webpages. Within XML their can also be subsets of languages including XSL which supports in validation and formatting.
2. Element Tags
You may make as well as name your element tags as you desire as well as suit your own specific requirements. Element tags enable you to build a hierarchical syntax and order to your code.
By way of example, let’s say you wished to have a stock list of your stock items for your ecommerce bike shop website, you can use key tag names like product, and also within the product tag element, you can have child elements like men’s bikes, women’s, child bikes etc.
The beauty and simpleness of XML is in its ability to build your own element tags, just be sure you close them.
<product> - element tag
</product> - closing tag
3. Declaration Statement
The declaration statement ought to be at the beginning of your xml file, the aim of the declaration statement is to specify the language, version as well as designate encoding and declare the standalone status of the file, without it the Internet processor will not be able to determine the code.
<xml version="1.0" encoding="UTF-8" standalone="yes">
4. Root Element
The root element, like the title indicates is the very first named tag of every XML file and it's a container for all other elements, consequently it is in the root.
<products> - root element
5. Parent Element
The parent tag retains elements linked to the root, and so within our example of products, the parent would be the associated categories or products.
<products> - parent element
<mens bike> - element tag
6. Child Element
The child element is so called, given it belongs to the parent element and thus, is situated inside it.
<products> - root/parent element
<mens bike> - parent element
<cube bike> - child element
7. Attributes
An attribute is a name or value that sits within the element tag, in our example an attribute could be frame size of the bike or the colour style.
<cube bike size="20"> - cube bike is the element and size is the attribute
8. Comments
Comments will be only viewable in the source and are generally mostly for editors and authors who want to update or customize the xml file, comments are not exposed on a webpage
<!--this is a comment -->
9. Data Strings
A data string will be the complete opposite of a comment in that it is viewable on the webpage, a data string in this context is the equivalent of the description field.
<description> - element tag
Extensive range of cube bikes available. - data string viewable on a webpage
</description> - closing tag
So that’s an easy and easy look at xml and the best way to create an xml file, to study more advanced material, you can search Google or check out this xml tutorial.
No comments:
Post a Comment