XHTML two point oh... or web 3.0?

Discussion in 'Web Development and Programming' started by Steven, Apr 18, 2008.

  1. Steven

    Steven Regular Member

    Joined:
    Mar 19, 2008
    Messages:
    18
    Likes Received:
    0
    Imagin one day... data access with the tips of your fingers and a few lines of code... no Server Side language nessassary... A broswer that instead of relying on Javascript to do AJAX calls, has that functionality built in... I see a growing problem in the Web 2.0 world where coding is getting to combersom and w3.org is standardizing way to much... I beleve with xhtml 1.1 that w3.org initiated is mearly a mold of play-doe with the same make-up, same mess. I belive since XML has hit the world it should be utilized better. Lets get away from HTML, and into the something more... something that actually does something... Here is and idea... check this code out:

    Code:
    XML File:
    <?xml version="1.0" encoding="UTF-8" ?>
    <bookstore>
      <book category="Fiction">
        <cover>http://img.downwithw3.org/books/9s81Sco2.png</cover>
        <title>How to Fart of Poop</title>
        <author>Steven</author>
        <year>2008</year>
      </book>
      <book category="Non-Fiction">
        <cover>http://img.downwithw3.org/books/5aQW21aC.png</cover>
        <title>7 Shapes of Poo for Highly Bloated People</title>
        <author>Stephen Covey</author>
        <year>1998</year>
      </book>
      <book category="Referance">
       <cover>http://img.downwithw3.org/books/bnA81C12.png</cover>
       <title>Fart in 50 Languages</title>
       <author>Joe Schmoe</author>
       <year>2008</year>
      </book>
    </bookstore>
    
    My XHTML Prototype:
    <html xmlns="http://www.downwithw3.org/2008/xhtml2.0">
    
    <head>
      <title>My XHTML</title>
      <datasource id="bookstore" type="text/xml" href="/data/xml/bookstore.xml" />
    </head>
    
    <body>
      
      <template datasource="bookstore" xpath="bookstore/book/>
        <content>
            <container select="@category" match="Fiction">
              <object type="image" select="cover" />
              <object type="text" select="title" />
              <object type="text" select="author" />
              <object type="text" select="year" />
            </container>
            <container select="@category" match="Non-fiction">
              <object type="image" select="cover" />
              <object type="text" select="title" />
              <object type="text" select="author" />
              <object type="text" select="year" />
            </container>
            <container select="@category" match="Referance">
              <object type="image" select="cover" />
              <object type="text" select="title" />
              <object type="text" select="author" />
              <object type="text" select="year" />
            <container>
        </content>
        <form method="append">
          <textbox id="cover" append="cover" />
          <textbox id="title" append="title" />
          <textbox id="author" append="author" />
          <textbox id="year" append="year" />
        </form>
      </template>
    </body>
    
    </html>
    
    With w3.org's introduction to xhtml1.1, there agenda was to seperated presentation data from form data and ultimatle content as well. But I say merge the content and form data... let them work together! With this example above, this does just that. The XML File is a standard XML file storing data. The XHTML Prototype(Name could change... lol) Starts out like a normal XHTML file... but then in the head has a "datasource" tag.. this tag will load into the memory the data provided, weather its a MDB, XML, or whatever type of source...(my example is specificly for XML) then below you see a template tag, almost like XSLT's... this initiates a template for data to be structured... this is where the magic takes place... before you had to have a XML file, XSLT file to tell the XSLT Processor(another thing you have to have on the server) how to display the XML Data, and then a Server Side Language to Do all that... But with just a few lines of code... and 2 files(XML, and this prototype) you have just pulled data, and began to delegate it... without a serverside call or processor to form the data(This assuming that a browser will process it instead.... that day may never come.. lol! but for cell phones it has... a WAP Browser does something similar to what I am saying).... n e way... so from the template to content... the content tag states that the tags inside are for displaying content... then the container tag works much like a div, where as it structures the data, but also has the ability to pull specific data with a condition(select all books that match "Non-Fiction" in the attribute "category") Then the object tag(this is neet.. lol) has no specific purpose until you tell it what kind of object it is... image, text, video.... its limitless... lol.. so you want an image... fine... just tell me I'm an image and then point me to the data that tells me my source... and wAla! Then same goes for Text and video.. etc... Each container will be seperated and will pull all data matching the condition.. then it will display the data into the objects secified... here you can then use CSS(Another damn language I want to redo.. lol!) to display the data how ever you want. Then you see a form tag(looks like HTML huh? its different..) This form has a method much different than from HTML's.. instead of this form being submited over to a server to be processed, it alread knows where it is going... the inside fields are pointed to specific names and are appened to the "bookstore" adding a new "book" because the method is "append", if the method was "insert" it would be editing a specific "book"... and so on.. This allows you to take a form field and directly add(or edit if you wish) a datasource... all without any other coding... (this is kind of like XForm) ...

    I'd have to say this would be so much easier than programming each and ever method of storing and displaying data ... Of cource you would still need server side languages for alot of other things.. but i beleive a standed way of storing and displaying data has been overdue for a long time...

    I know im not always easy to understand so if you have any questions about this idea or comments.. just say so... I think this is possible.. any one with a knowledge in programming could easily develope a simple browser that would handle this code... it would be sweet.. lol
     
  2. rangana

    rangana Regular Member

    Joined:
    Apr 12, 2008
    Messages:
    106
    Likes Received:
    0
    Location:
    Cebu City Philippines
    First of all, what point are you raising :-?

    I disagree with what you said :glare:

    XML could'nt replace XHTML nor HTML....both have different purpose...XML was'nt created to replace HTML nor XHTML.

    XML was designed to transport and store data, with focus on what data is. But still, this XML document does not DO anything. It is text wrapped into tags, a plain text, nothing special :roll:

    HTML was designed to display data, with focus on how data looks.
    It's hard to imagine that day,,,nearly impossible..and if ever that happens...W3 should inform web developers more importantly web designers with regards to whatever changes on standardization they would make...I believe it will be informed 2 to 3 years early before that havoc would occur :shock:
     
  3. Steven

    Steven Regular Member

    Joined:
    Mar 19, 2008
    Messages:
    18
    Likes Received:
    0
    Wow... hmmm... like I said, I am not easy to understand... thats because I lack the ability to explain myself better.

    First off... I know what XML is and I use it.... and You clearly missed my point. My focus was not on xml but rather a restructure of XHTML... an HTML will more functionality.... more objects... more intertwining with data. Right now if you want to pull an XML file(which is simple text) and structure it you have to develope a server side script(I use ASP.NET) which takes a XML file and a XSLT file(which tells XML/XSLT processor what to do, one for instance I use is MSXML)

    Example:

    Code:
    example.xml :
    <?xml version="1.0" encoding="UTF-8"?>
    <bookstore>
      <book category="Non-Fiction">
        <title>I know XML</title>
        <author>Steven</author>
        <year>2008</year>
      </book>
      <book category="Fiction">
        <title>XML has Friends</title>
        <author>Steven</author>
        <year>2008</year>
      </book>
      <book category="Referance">
        <title>XML for stupid people who think they know XML</title>
        <author>Steven</author>
        <year>2008</year>
      </book>
    </bookstore>
    
    example.xslt:
    
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:template match="/">
      <xsl:for-each select="bookstore/book">
        <div class="book">
          <div class="title"><xsl:value-of select="title" /></div>
          <div class="author"><xsl:value-of select="author" /></div>
          <div class="year"><xsl:value-of select="year" /></div>
        </div>
        
    
      </xsl:for-each>
    </xsl:template>
    
    example.aspx :
    
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Xml ID="XMLData" runat="server"></asp:Xml>
        </div>
        </form>
    </body>
    </html>
    
    example.aspx.vb :
    
    Imports System.Xml
    
    Partial Class example
        Inherits System.Web.UI.Page
        
        Protected Sub example_Load(ByVal Sender As Object, ByVal e As System.EventArgs) Handles example.Load
            XMLData.DocumentSource = "/data/xml/example.xml"
            XMLData.TransformSource = "/data/xslt/example.xslt"
        End Sub
    
    End Class
    
    
    All That code just to make it do this:

    I know XML
    Steven
    2008

    XML has Friends
    Steven
    2008

    XML for stupid people who think they know XML
    Steven
    2008

    You see, thats quite a bit of coding just to some simple like that, and yes I know there are other simpler ways like with CSS... but if you want robust functionality over your XML, such as updating, deleteing... etc... you need a server side language and all this coding. What I was suggesting was making it simpler, making usage of the client side rather than the server side. This would involve a updated browser to handle such coding as I suggested above.

    Its not hard to imaging the ablility to load data into memory such as an XML file to then be used and munipulated client-side and then posted back to there server. We can do such things as of now using AJAX that gives the illution of a application on a website. But the headache it is to code so much just to do so little its remarkable. AJAX is great, and I don't see it going anywhere anytime soon. But I think that data access needs some doctoring and should be addressed.
     
  4. rangana

    rangana Regular Member

    Joined:
    Apr 12, 2008
    Messages:
    106
    Likes Received:
    0
    Location:
    Cebu City Philippines
    Yah, not I got your point, my apologies for traversing the other way around :D

    ...Well, I don't know much on XML. I"m more of HTML and XHTML...:rolf:

    ...If we rely much on client-side scripting, it's not that feasible...users can always disabled their js :(
     

Share This Page