SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using my own markup

    Hi All,

    how would i go about configuring my header so that i can use my own markup language XML style e.g.

    instead of <div id="mainpage"></div>
    i would use <mainpage></mainpage>

    Then style it with mainpage {text-size:40px;}

    XHTML 1.0 Transitional? does it validate? is it bad practice?


    Just looking at my site, it would be far more easy to manage using my own markup, dont you think?

    Whats your thoughts on this?

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,269
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)

    extending

    Interesting thought. The "X" does stand for extensible so I imagine there is a way. You will most likely need to use namespaces and add it to the DTD line. And I don't think browsers will know how to style them if you forget to specify CSS for them.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The good news is that it's easy to do this. The bad news is that it's utterly useless.

    If you want to extend XHTML, or use your very own application of XML, all you have to do is to provide CSS rules for the formatting and make sure to serve the document as an application of XML. You can write your own DTD and use that instead of the standard XHTML DTD, if you want to validate the markup.

    The problem is that you can't specify semantics, which means browsers, search engine 'bots and assistive technologies won't have a clue what you're on about. The extensibility of XHTML is, to a large degree, a myth. You'd need to write browser plug-ins to make any real use of your home-grown markup language.

    If you want to use XML, the best approach is to use server-side XSLT to transform it into normal HTML or XHTML before delivering it to user agents.
    Birnam wood is come to Dunsinane

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,871
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Just remember that you have to serve it as real XHTML if you extend it. That means that anyone using IE8 or earlier (and probably IE9+ as well) will not be able to access your page at all.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the replies, although not what i wanted to hear hehe

    To me coding like this makes far more sense. more compact code, self descriptive, neater layout, lovely :-)

    I cant see the point in giving elements id's and classes just to style the thing, when this should more be used for interaction with scripting e.g. javascript etc.

    I guess its still too soon :-(
    *goes back into cryostasis for another few years*

  6. #6
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Well, it does have one use : ) When writing code for someone to explain what you're doing, you use your own tags as pseudo code. I'm a lazy one, so I do it all the time.
    <body>
    <container>
    <header></header>
    <sidebar></sidebar>
    <main>
    stuff
    </main>
    <footer></footer>
    </container>
    </body>

    Everyone can look at that and know immediately how the page is set up HTML-wise. : )

  7. #7
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,269
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)

    Xml

    I think AutisticCuckoo's XSLT suggestion may be a good option for you. You could manage your own XML files using the tags that make more sense to you and still serve XHTML to browsers.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •