xhtml

XForms and Internet Applications

Ecole d'Eté d'Informatique CEA - EDF - INRIA 2003

Ecole d'Eté d'Informatique CEA - EDF - INRIA 2003

Modelware : Vers la modélisation et la sémantisation de l'information

Saved By: amarois | View Details | Give Thanks

Tags: , , , , , , , , , , , ,

Xforms Multiple Constraints

Here is an example code for how to do multiple constraints on a form.
<?xml version=”1.0″ ?>
<?xml-stylesheet href=”xforms.css” type=”text/css”?>
<html xmlns=”http://www.w3.org/1999/xhtml”
xmlns:xf=”http://www.w3.org/2002/xforms”>
<head>
<title>Using XForms</title>
<xf:model id=”login”>
<xf:instance xmlns=”">
<verifyUser>
<userID1/>
<userID2/>
<password1/>
<password2/>
<email1/>
<email2/>
</verifyUser>
</xf:instance>
<!– This will NOT work!! (although it will work for a singlen constraint)
<xf:bind constraint=”//userID1=//userID2″ />
<xf:bind constraint=”//password1=//password2″/>
<xf:bind constraint=”//email1=//email2″/>
–>
<xf:bind nodeset=”//userID1″ constraint=”.=//userID2″/>
<xf:bind nodeset=”//password1″ constraint=”.=//password2″/>
<xf:bind nodeset=”//email1″ constraint=”.=//email2″/>
<xf:submission action=”viewsubmitdata.php” method=”post” id=”loginsubmit”/>
</xf:model>
</head>
<body>
<xf:input ref=”//userID1″ model=”login”>
<xf:label>Username1 </xf:label>
</xf:input>
<xf:input ref=”//userID2″ model=”login”>
<xf:label>Username2 </xf:label>
</xf:input>
<xf:input ref=”//password1″ [...]

Yahoo! uses XForms for 'write once, run anywhere' mobile applications

Yahoo! recently announced their entry into the mobile web applications space, with a service that allows applications to be built and hosted using Blueprint, a purpose-built mark-up language based on XForms.

The Blueprint roadmap describes the underlying philosophy:

Much of Blueprint's philosophy and syntax comes from XForms. We opted for a full declarative language because it was the only way we could effectively run on the wide range of devices out there, some of which have no scripting at all. By using declarative syntax, we can encapsulate and hide the scripting specifics. In some cases, the code could run on the phone, in other case, such as XHTML, we can put the logic on our servers. It's the perfect way to deal with the various environments and their capabilities.

At the moment Blueprint is simply converted to XHTML plus JavaScript for delivery to devices, but the mention of XForms gives a clear indication of where they are heading. And given that Google did something similar with the launch of its Google Mashup Language, it all bodes well for a new wave of web applications that won't be built using JavaScript (or even Java and GWT) but will use straightforward, device-independent, mark-up.

Write once, run anywhere, anybody?

For more on why XForms is Ajax on steroids, see:

FormFaces.com

FormFaces.com

An EcmaScript library for transforming XForms data to XHTML 1.0

Saved By: clacke | View Details | Give Thanks

Tags: , , , , ,

An Xquery article by Kurt Cagle

XQuery, the Server Language
An Xquery article by Kurt Cagle.

A better Legendary Toggle

I put a toggle inside a legend simply because it just popped in my head to try it. This same procedure could work with any type of grouped data without having a legend at all (see Switch/Case Toggle Template or Using Switch Case as a drop down box).
In my post Xforms: The Legendary [...]

Thoughts on xforms php and the DOM

Anyone who has followed my blog knows that I use php to parse my xml data by simply putting my data into an indexed array or an associative array and then manipulating the data as you would any other arrayed data (see http://clarkepeters.wordpress.com/2007/09/02/parsing-without-the-dom-or-.... I’m not advocating, however, that this is the best [...]

Hiding dropovers with CSS and Xforms

A dropover is a drop box that is intended to drop down over any elements that are displayed below it.
For an example see Drop Down over/above lower text (Xforms Switch and CSS). In fact, you’ll need to look over that post to get an idea of what’s going on here (you may want [...]

No files selected (using xf:bind and relevant)

I have an xhtml+xforms form in which users are viewing or deleting files from their server. (see earlier posts if you want to know more).
The file names are stored in an xml instance that the xforms is based on. The file names are listed as items in an xf:select1 control (actually in this case, it’s [...]

Drop Down over/above lower text (Xforms Switch and CSS)

Here are some images that show how the Switch/Case Toggle works (see Switch/Case Toggle Template ) . In this particular example, notice how the box drops down above the division below it rather then pushing that division down (which is how it normally operates without any CSS styling). [...]

Switch/Case Toggle Template

Here’s template I keep handy for what I call my switch/case toggle box– I use it especially for tips and notes but it could be used for just about anything.
<!– ********** SWITCH/CASE TOGGLE***************************** –>
<!– Lorem ipsum –>
<xf:switch>
[...]

Directory list: process delete files

Previously we set up our Xforms to send some file names to our php file (see Directory List: Delete files )
Here’s the php to process them.
<?php
header(”Content-type: application/xhtml+xml”);
//header(”Content-type: text/plain”);

include(”fnGeneric.php”);
include(”fnMisc.php”);

if (!isset($HTTP_RAW_POST_DATA))
$HTTP_RAW_POST_DATA = file_get_contents(”php://input”);

//put the data into an associative array (see my Parsing without the DOM for this function)
$data=xmlSTR2xmlAssocARR($HTTP_RAW_POST_DATA);

/* an Xforms select control [...]

Using Xforms for Redirecting/Reloading pages

In an earlier post– don’t hit the back arrow! — I was using Xforms to prevent loss of recent data from a browsers back button or browser reload page, in which case the user would be directed to an interim page that had some instructions about navigating the site and also a button where they [...]

Migration in progress … … …

We still have some things to do, but the old posts have now been moved to the new site.
at: http://ztags4xforms.com/wordpress/

Sidewinder and the need for a semantic web applications framework

A couple of recent discussions in the RDFa and microformat communities concern areas of particular interest to those of us working on Sidewinder, a semantic web applications framework.

The initial discussion is taking place on the microformats lists, and concerns how to allow authors to indicate what actions are available to be performed on items appearing in a document. The second discussion is taking place on the 'RDF in XHTML Task Force' list; this post provides a good summary of some of the issues.

All in all I find these very exciting discussions, because they concern exactly the types of use-case that prompted me to get involved with the XHTML work at the W3C a number of years ago.

This was because I'd been trying to create the kind of flexible user interface that these threads are describing--no doubt just as lots of other people had--and in my own endeavours I ran up against a number of very serious problems that made me conclude that it was pretty much impossible with the technologies available at the time. And since I still haven't seen a convincing solution to the problem of creating extremely flexible user interfaces, I've concluded that the issues I ran up against are of quite a fundamental nature.

Some of the problems that seem to me to be absolutely necessary to solve are:

  • an HTML page contains insufficient metadata about what its content 'means', making it difficult to work out what kind of UI constructs to render;
  • even were you are able to work out what the data means, HTML is not itself powerful enough to express the kinds of complex user interfaces that you would want to 'bind' to this underlying data;
  • and even if you work out what the data means and define complex UI components, you still can't define binding rules that indicate what widget to use with what data;
  • the browser offers only one 'paradigm' for interacting with information of interest, whilst we often want to create applications that can make use of the same rich features.

For every problem...

The first problem--that HTML is not 'rich' enough--is now largely solved by RDFa. It has taken quite a long time to get here, but I think the effort that has gone into getting RDFa right is going to be worth it. The key thing that RDFa does is to get RDF into HTML--once you've got that, all sorts of possibilities open up.

The second problem--that it's difficult to define rich user interfaces with only HTML--is largely solved by XForms. That XForms is a solution is currently not obvious to most people so XForms remains peripheral in application development at the moment. Of course it is possible to define widgets using script but it quickly gets very messy. There is also an enormous problem of re-use, in the recursive sense; most Ajax libraries are works of art, but very few can support the kind of complexity we need. Take the example shown here:

Metabar showing metadata for a BBC news story

Here we have widgets that are made up of other widgets to an arbitrary depth, but the key thing is that the binding mechanism is based on abstractions; it could be the run-time data type or an abstract widget type, and in both cases it means that at any point in the hierarchy a different widget could be swapped in without disturbing anything above or below. This kind of complexity is extremely difficult to achieve with procedural languages. (See also Introduction to custom controls and Understanding the MVC separation.)

The third problem--the use of binding rules to indicate which widget should be connected to what data--is still a little in the air. One part of it we've solved by specifying binding 'rules' using XPath selectors that are data type aware. This means that we can indicate that data of type 'geo location' should have one set of behaviour bound to it, whilst data of type 'time' can have a different type. These are essentially binding stylesheets and I think this is where we can answer the question posed on the RDFa list as to whether it is the author, the end-user or the browser vendor that should be in control of the widgets--the answer is all of them! By allowing users to express binding rules that override those from authors, we can achieve the best of both worlds.

Finally, the problem that the only paradigm we have for interacting with web-based data is 'browsing' is what we are trying to solve with Sidewinder. The ultimate goal is to have a framework that can be used to build any type of internet-facing application, whether web or desktop based. By allowing all applications to make use of the same semantic functionality and the same binding rules we can allow the users themselves to get control of their data and their applications. (See also Web 2.0, Copernicus and Sparticus: Moving the centre of the web.)

Silverlight clock as a custom control in XForms/formsPlayer

Once you have this kind of 'platform' (see Platform 2.0) then things really start to open up. I could build a clock widget using Silverlight, perhaps, and have that appear anywhere that the time data type is used--whether in my messaging client, my email client, my Twitter gadget, my Facebook desktop notification system, and so on. But you might choose a clock built using SVG, whilst someone else might decide to have a clock that speaks. But any of us could swap one of these behaviours for another at will, for a component we have created or one that we have downloaded from elsewhere--the ultimate, flexible, programming platform.