PDA

Click to See Complete Forum and Search --> : Create Your Own Mark-Up Language


mikester2
January 26th, 2005, 11:14 PM
It's common knowledge that html/xhtml can be used to mark-up webpages, but did you know you can make your own webpage mark-up language using XML. First you'd need to create the rules for your language with a DTD (more info here (http://www.w3schools.com/dtd/default.asp) ). Next you'd need to mark-up a XML document following the rules you had laid down in your DTD (more info here (http://www.w3schools.com/xml/default.asp)). Finally you could apply style/presentation to your XML webpage by linking in a CSS stylesheet (more info here (http://www.w3schools.com/css/default.asp)).

This means that the following really could be valid website code:-

<peopleihate>
<person>Zoe</person>
<person>Kenny</person>
<person>Cherry</person>
</peopleihate>

el-half
January 28th, 2005, 10:53 AM
I was told the DTD principle is obsolete and that something else is now being used instead.
I have not done anything with xml since it grow out of development/experimental stage though.

mikester2
January 29th, 2005, 08:34 PM
That is sort of true, although i feel the word "obsolete" would be a little too strong. The fact is that many now use something called a schema (more info here (http://www.w3schools.com/schema/default.asp)) to define their mark-up languages. A schema is basically an XML document used to define the rules for another XML document. This brings many advantages over a standard DTD such as allowing data types to be defined, letting a more well known and understood language (i.e. XML) define the rules and making the rules extensible. You maybe thinking at at the moment "but if an XML document (schema) is used to define the rules for another XML document, what defines the rules for the XML ruleset document?" The answer is that a DTD is used to define these rules.

So in summary XML schema's are being used to define XML mark-up rules, but the rules for the document of rules is written using a DTD, hense why DTD are still needed.