[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Challenge


xforms replace
Hi Mark,

The good point about your post and the challenge is that it made me
re-discover XForm. IN fact I re-discovered why I need XForm instead of
simply the XML document, an XSLT stylesheet and a bit of prototype based
programming (ref: http://en.wikipedia.org/wiki/Prototype_based). In fact the
problem occurred when I tried to bind a particular element from the source
XML document to an XHTML element; I am not able with XSLT 1.0 to obtain the
XPath expression of a node. So it seems that I need to do it by hand and
define it somewhere. This is precisely the kind of functionality offered by
XForms :-)

By the way, I may be wrong but in the XForms example you provided could the
binding be as follows: 
<xforms:model>
        <xforms:submission id="submit" 
                            xforms:replace="all"
                            xforms:action="http://mydomain.com/MyStorage"
                            xforms:method="PUT"/>
     <xforms:instance id="theChallenge">
          <demo xmlns="">
             <version/>
             <author>    
                <name/>
                <email/>
              </author>
              <description/>
           </demo>
      </xforms:instance>
      <xforms:bind id="version" nodeset="//version" constraint=". = '1.0'"/>
      <xforms:bind id="name" nodeset="//author/name"/>
      <xforms:bind id="email" nodeset="//author/email"/>
      <xforms:bind id="description" nodeset="//description"/>
</xforms:model>

In which each XML element is referred by an XPath 1.0 expression and I need
to include a "bind" attribute to each XHTML element used to input data. For
instance, the XHTML element used to input the <version> element will include
the "bind" attribute as follow:
 <input bind="version" type="text" name="version" size="20"/>
 (no <label> element, this is an XHTML element)
In this last case, the "bind" is redundant with the "name" attribute and I
guess that the "bind" attribute can be omitted and replaced by the
functionally equivalent "name" attribute. Anyway, it could be useful to
trace back the binding "explicitely".

I can write this whole XForms definition differently as follow:
xforms:model>
        <xforms:submission id="submit" 
                            xforms:replace="all"
                            xforms:action="http://mydomain.com/MyStorage"
                            xforms:method="PUT"/>
     <xforms:instance src=http://myDomain.com/theChallenge.xml" />
                            .....
                            .....
     <input ref="//version" type="text" name="version" size="20"/>

Cheers
Didier PH Martin
http://didier-martin.com




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.