140 likes | 157 Views
This presentation provides an overview of XHTML, XForms, XML Events, and Device Independence based on W3C specifications as of April 2002. It covers the features, goals, components, and usage scenarios of these technologies.
E N D
XHTML, XForms, XML Events &Device Independence Based on W3C Specs as of April 2002 Marc Abrams Abrams@vt.edu
XHTML Overview • XHTML 1: Put HTML4.01 into XML syntax • XHTML 1.1: Modularize XHTML for “resource constrained devices” • DOM-2 support: Attach event handlers to XHTML elements via XML Events
XForms Goals • Provide richer Web forms • Multiple forms per page, and pages per form • Provide form processing model: • Forms Submit Protocol • Suspend and Resume support • Provide forms on various devices • Seamless integration with other XML tag sets(XHTML, WML, …) • Relies on XML model of form data(vs. HTML’s simple name=value pairs) • XForms Model to describe structure of XML Instance Data • Separate data, logic and presentation
Relation of XForms Components Diagram from W3C: http://www.w3.org/MarkUp/Forms/arch1.png
Usage Scenario Underlying XForms • Web designer starts with a purpose (e.g., data collection) • Purpose is realized by interactive presentation (a form) • Completion of form produces data • Example:Purpose =find # students in a coursePresentation =form with list of course #sData =chosen course number
Old style HTML Form <form action="http://example.com/submit" method="post"> <label> <input type="radio" name="as" value="cash"/> Cash </label> … </form>
XForms Example (1) <xforms:model> <xforms:submitInfo action="http://examples.com/submit" id="submit"/> </xforms:model>
XForms Example (2) <input ref="cc"> <caption>Credit Card Number</caption> </input> <submit submitInfo="submit"> <caption>Submit</caption> </submit>
Data Submitted by Browser Hey, it’s XML, not that weird http://…?x=123! <instanceData> <as>Credit</as> <cc>1235467789012345</cc> </instanceData>
Instance Data Is Described by Model <xforms:model> <xforms:instance> <payment as="credit" xmlns="http://commerce.example.com/payment"> <cc/> </payment> </xforms:instance> <xforms:submitInfo action="http://example.com/submit" method="post"/> </xforms:model>
XML Events Motivation: • HTML does this: <img onMouseOver = “document.images.button1.src='click.gif‘”> • Problems: • Must change HTML to add new event names • Mixes event handling into document content
XML Events - Example <a id="link1" href="doc.html">The <em>draft</em> document</a> … <listener event="click" observer="para1" target="link1" handler="#clicker"/> You can attach listeners to any XML tree node.
Conclusion • XHTML is modular, but not truly device independent • XForms is device independent, but only provides a form metaphor • They are limited to XML languages (not Java, C++) • So these are steps toward general device independence, but not a full solution
References • XML Events(http://www.w3.org/TR/2001/WD-xml-events-20011026/) • XForms - The Next Generation of Web Forms (http://www.w3.org/MarkUp/Forms/) • XHTML Roadmap(http://www.w3.org/MarkUp/xhtml-roadmap/)