Search This Blog

Friday, November 9, 2007

Use an XForms Document as a Custom XML Edito

A previous article in this series showed how to use XSLT 2.0 to
transform an XML tournament document into an HTML bracket that displayed
the tournament results. What we didn't address in that article is how
to fill in the winners and losers for that XML tournament. In this
article, we'll revisit our XML tournament and create an XForms document
that lets us fill in the tournament results without an angle bracket in
sight. The result is an attractive editor for our bracket document type,
complete with Ajax-like effects. Best of all, our use of XForms means
the custom editor is built with declarative markup and is based on the
data structures in the XML document itself. The article addresses: (1)
Defining the layout of the XHTML page; (2) Importing the data model
(our XML bracket) into the XForms document; (3) Defining the panels that
display the matchups; (4) Defining the panel that displays the bracket;
(5) Defining the navigation buttons; (6) Defining the XForms actions
to save and reset the tournament data. A user who selects the winners
of the 15 matchups automatically creates a complete, valid XML document.
To simplify development and maintenance, we refactored the markup in
our XForms document by generating it with an XSLT stylesheet. In our
example here, we simply wrote that document to a file; we could have
just as easily submitted the XML document to a Web application. Best
of all, everything in the XForms document is tied directly to the XML
data model. More Information, See also XML and Forms: Click Here

No comments: