Assigning Meaning to XML Tags
Structure merely expresses the form of the document, without regard for differences between individual tags and elements. For instance, the four XML documents shown below are structurally the same. They all specify documents with a single non-empty, root element. The different names of the tags have no structural significance.
<?xml version=”1.0” standalone=”yes”?>
<FOO>
Hello XML!</FOO>
<?xml version=”1.0” standalone=”yes”?>
<GREETING>
Hello XML!
</GREETING>
<?xml version=”1.0” standalone=”yes”?><P>
Hello XML!
</P>
<?xml version=”1.0” standalone=”yes”?><DOCUMENT>
Hello XML!
</DOCUMENT>
Semantic meaning exists outside the document, in the mind of the author or reader or in some computer program that generates or reads these files. For instance, a Web browser that understands HTML(Hper Text Markup Language) but not XML(eXtensible Markup Language), would assign the meaning "paragraph" to the tags <p> and </p> but not to the tags <GREETING> and </GREETING>, <FOO> and </FOO>, or <DOCUMENT> and </DOCUMENT>. An English-speaking human would be more likely to understand <GREETING> and </GREETING> or <DOCUMENT> and </DOCUMENT> than <FOO> and </FOO> or <P> and </P>. Meaning, like beauty, is in the mind(or eye) of the beholder.
Computers, being relatively dumb machines, can't really be said to understand the meaning of anything. They simply process bits and bytes according to predetermined formula (albeit very quickly). A computer is just as happy to use <FOO> or <P> as it is to use the more meaningful <GREETING> or <DOCUMENT> tags. Even a Web browser can't be said to really understand that what a paragraph is. All the browser knows is that when a paragraph is encountered a blank line should be placed before the next element.
Natuarally, it's better to pick tags that more closely reflect the meaning of the information they contain. Many disciplines like math and chemistry are working on creating industry standard tag sets. These should be used when appropriate. However, most tags are made up as you need them.
Here are some o
2 comments:
i don't understand.. ^^
i'm newbie..
Ok, just check out our older posts on the subject there we explained from the basis this terminologies as regards XML incase you do not still understand let me know i'll give you a personal tutorial free of charge on your email
Post a Comment