OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Serialising XML Schema to HTML form and getting it backas XML instance

Thank you for such a throughout reply Philip!

I would very much be biased in favour of using Xforms client side, although it still looks like I'll be sending HTML + JS over the wire, so the benefits over server side are more related to future proofing and promoting a good standard than anything else, I guess.
Now I need to do some advocacy on XForms in particular and XRX in general. Could someone have any useful resources on that too?
Again - having attended quite a few events, I have gathered enough confidence and enthusiasm to try and consider such approach in production, but what I've seen were mostly proof of concept demos with specific piece of technology (Sausalito, Oracle or MarkLogic), rather than generic XRX propaganda...


On 8 October 2010 17:15, Philip Fennell <Philip.Fennell@marklogic.com> wrote:


If you are going to use XForms, and I'd recommend it for the case you describe, then you shouild, depending on how you want to serve-up the forms, use either a server-side XForms implementation like Orbeon or betterForms, otherwise you should look at XSLTForms or Formular if you want to do things client-side.
Depending upon how the schemas are constructed it is not too difficult to transform (XSLT) from an XML Schema into XForms and for validation you can either take one of two approaches:
1) Use Schema Validation within the XForms, then you get validation on the spot (structure and values).
2) Depending on the amount and type of validation (values only) you could generate XForms constraints that will provide validation of user input.
The former you get for free with XForms, the latter you have to generate as part of the transformation.
> but it looks like XForms are still not natively supported in the
> browsers so I think not much has changes in recent years and
> we'll have to generate HTML Forms from the schema.
Have a good long look at the implementations page on the XForms Wiki:
Native support there may not be but there has been considerable movement amongst both client-side and server-side implementations, many (if not all) supporting a lot of XForms 1.1 features and also adding XPath 2 which is very handy for constraint expressions.
If you go down the XForms route you'll save yourself a lot of hassle in the long run compared to trying to re-invent the same features with HTML Forms, JavaScript and server-side code. After all, the majority of the XForms implementations that deliver HTML Forms + JavaScript have, in effect, done all that work for you.

Philip Fennell

MarkLogic Corporation

Mobile +44 (0) 7824 830 866

email  Philip.Fennell@marklogic.com
web    www.marklogic.com

This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation.


From: Lech Rzedzicki [xchaotic@gmail.com]
Sent: 08 October 2010 14:58
To: xml-dev@lists.xml.org
Subject: [xml-dev] Serialising XML Schema to HTML form and getting it back as XML instance

Hi all.

We have a XML schema that we would like to use to:
1. generate HTML form/XForm/ whatever works bests.
2. User fills in the form fields in a browser, with as much validation possible client side (probably some JS library).
3. The form is sent back to the server, ideally as XML instance straight away or converted server side so that it can be validated against the schema and stored.

What's the current state of the art in this?
It's a greenfield project so we're free to use whatever we want, but it looks like XForms are still not natively supported in the browsers so I think not much has changes in recent years and we'll have to generate HTML Forms from the schema.
It looks equally backwards when sending/POSTing the data - it looks like the data will be sent using the usual HTTP headers and then we have to worry how we convert it back into XML for validation, right?

Any thoughts on how to do it as automatically and pain free as possible, would be very welcome.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS