Kojo,

Without getting more of an idea of how the file is currently structured, I'm
not sure what particular part of the problem is going to be the most
important for you to solve. For example, if it's simply the management of a
large number of controls, then the XForms <repeat> element is ideal -- it
iterates across a nodeset, and renders a template for each node. So, if you
had 23 elements called 'data' in your instance data, you might do this:

    <xf:repeat nodeset="data">
      <xf:trigger appearance="minimal">
        <xf:label>
          <svg:svg width="100" height="100" viewBox="0 0 100 100">
            <svg:rect fill="green" x="0" y="0" height="100" width="100" />
          </svg:svg>
        </xf:label>
        ...
      </xf:trigger>
    </xf:repeat>

and you would get 23 buttons. (I'm sure you don't mean that you have 23
identical buttons, but this technique may account for at least some of
them.)

On you other hand, you might be talking about how you actually 'wire' the
XForms data to the SVG 'widgets'. This is best done through events, and a
very simple example is here (the bars in the bar chart are updated with the
current temperature, obtained from a weather web service):

  <http://www.formsplayer.com/demo/web-services/weather-svg.html>

The script in this example is only concerned with taking the data from the
XForms instance and putting it into the correct places to get the height of
the bars, labels, etc. Although ideally we would even get rid of this
script, at least it does mean that by using XForms we're not having to write
all the other script to send and receive data requests, validate the data,
send change events to the UI, and so on. If you can reduce your script to
perform just this purpose -- essentially connecting the model to the view --
then the final step will be to replace this script with XBL or a close
relative.

For example, the script in the weather demo that takes a value from the data
and uses it to set the height of a bar can be replaced with a simple
declarative statement in XBL 1.0.

Anyway, if you are able to post parts of your form to this list it would
help, and I think it might be an interesting exercise to see how it could be
converted to declarative mark-up using XForms and SVG (and others may be
able to see how much of it can be done in Mozilla, too).

Regards,

Mark



Mark Birbeck
CEO
x-port.net Ltd.

e: [EMAIL PROTECTED]
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/

Download our XForms processor from
http://www.formsPlayer.com/

> -----Original Message-----
> From: A.M.Shourbagui [mailto:[EMAIL PROTECTED] 
> Sent: 19 December 2004 02:08
> To: [EMAIL PROTECTED]
> Subject: RE: [svg-developers] Re: SVG post server request...
> 
> 
> 
> Well I have tried it and it works fine it just needs
> some enhancements to be imlemented..
> Yet I think it is ideal with my project as I have a
> web server with very very limited capabilities...so I
> want to get rid of scripting as much as possible ..
> but I do have a large svg file and around 23
> buttons..how can I integrate xforms with each svg
> button...is there a scenario for that...
> thnx a million
> Kojo
> --- Mark Birbeck <[EMAIL PROTECTED]> wrote:
> 
> > Jeff,
> > 
> > To show how powerful XForms + SVG is, I took your
> > snippet of code, and
> > turned it into XForms + SVG -- your SVG rectangle is
> > still used to initiate
> > the submission, but the submission and event
> > handling is defined in terms of
> > XForms rather than bits of script.
> > 
> > I've also replaced your alerts with XForms messages,
> > which allows me to show
> > off some additional features, namely putting further
> > SVG in the messages.
> > 
> > Finally, I've put a bit more SVG into the
> > mouseover/hint to show how easy
> > that is -- not something that's very easy to do
> > without even more script in
> > SVG.
> > 
> > The entire mark-up is here, and a link to a live
> > form on our server is at
> > the end:
> > 
> >   <?xml version="1.0" encoding="utf-8"?>
> >   <html
> >    xmlns="http://www.w3.org/1999/xhtml";
> >    xmlns:ev="http://www.w3.org/2001/xml-events";
> >    xmlns:xf="http://www.w3.org/2002/xforms";
> >    xmlns:svg="http://www.w3.org/2000/svg";
> >   >
> >     <head>
> >       <xf:model>
> >         <!--
> >           The data we want to submit
> >         -->
> >         <xf:instance>
> >           <test xmlns="" />
> >         </xf:instance>
> > 
> >         <!--
> >           This is the actual submission -- send the
> > data
> >           referred to, to the specified URL, and put
> > the
> >           returned value in the same instance.
> >         -->
> >         <xf:submission id="s1"
> > action="http://example.org";
> >          method="post" replace="instance">
> >           <!--
> >             The event xforms-submit happens on the
> > reqest,
> >             but before the work is done. We show a
> > modal
> >             message at this point. Note that the
> > message
> >             has SVG in it.
> >           -->
> >           <xf:message level="modal"
> > ev:event="xforms-submit">
> >             About to post because you pressed the
> > red square that looks
> >             like this 
> >               <svg:svg width="25" height="25"
> > viewBox="0 0 100 100">
> >                 <svg:rect fill="red" x="0" y="0"
> > height="100" width="100" />
> >               </svg:svg>
> >           </xf:message>
> > 
> >           <!--
> >             The event xforms-submit-done happens
> > when
> >             submission is complete, provided there
> > is no
> >             error. We show a modal message at this
> > point,
> >             too.
> >           -->
> >           <xf:message level="modal" ev:event="xforms-submit-done">
> >             XML posted
> >           </xf:message>
> >         </xf:submission>
> >       </xf:model>
> >     </head>
> >     <body>
> >       <!--
> >         This is the 'button' that initiates the
> > submission.
> >       -->
> >       <xf:submit submission="s1"
> > appearance="minimal">
> >         <!--
> >           The label is SVG ...
> >         -->
> >         <xf:label>
> >           <svg:svg width="100" height="100"
> > viewBox="0 0 100 100">
> >             <svg:rect fill="red" x="0" y="0"
> > height="100" width="100" />
> >           </svg:svg>
> >         </xf:label>
> >         <!--
> >           ... and the hint (usually a mouseover) is
> > also
> >           SVG -- in this case a smaller version of
> > the
> >           actual trigger
> >         -->
> >         <xf:hint>
> >           <svg:svg width="100" height="100"
> > viewBox="0 0 100 100">
> >             <svg:rect fill="blue" x="0" y="0"
> > height="100" width="100" />
> >           </svg:svg>
> >         </xf:hint>
> >       </xf:submit>
> >     </body>
> >   </html>
> > 
> > This form will work as is in a future version of
> > Mozilla, and it works today
> > in Internet Explorer if you have formsPlayer and ASV installed.
> > (object/import tags need to be added, but a
> > forthcoming version of
> > formsPlayer removes this need.)
> > 
> > The form above is live here:
> > 
> >  
> >
> <http://www.formsplayer.com/demo/svg/simple-submit.html>
> > 
> > so if you have fP and ASV installed you can try it
> > now. Try moving your
> > mouse over the 'button' (the red square) and seeing
> > the hint which includes
> > further SVG. Also click on the 'button' to get a
> > submit, and see the first
> > message -- also with SVG -- followed by the failure
> > message (the submit
> > won't work).
> > 
> > And all with no script!
> > 
> > Regards,
> > 
> > Mark
> > 
> > 
> > Mark Birbeck
> > CEO
> > x-port.net Ltd.
> > 
> > e: [EMAIL PROTECTED]
> > t: +44 (0) 20 7689 9232
> > w: http://www.formsPlayer.com/
> > 
> > Download our XForms processor from http://www.formsPlayer.com/
> > 
> > 
> > > -----Original Message-----
> > > From: Jeff Rafter [mailto:[EMAIL PROTECTED]
> > > Sent: 17 December 2004 17:34
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: [svg-developers] Re: SVG post server
> > request...
> > > 
> > > 
> > > 
> > > Here... note, this may or may not work in
> > different
> > > implementations and
> > > may or may not let you do cross site posting. It
> > depends on
> > > the environment.
> > > 
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <svg xmlns:xlink="http://www.w3.org/1999/xlink";
> > >       xmlns="http://www.w3.org/2000/svg";>
> > >    <title></title>
> > >    <defs>
> > >      <script type="text/javascript"><![CDATA[
> > > 
> > >        function DoPostComplete(status) {
> > >          alert("XML posted - " + status.content);
> > >        }
> > > 
> > >        function DoPost() {
> > >          if (typeof postURL=='undefined') {
> > >            alert('Sorry, but the viewer you are
> > using does
> > > not support
> > > the URL interaction. ' +
> > >              'Try updating to a newer viewer.');
> > >            return;
> > >          }
> > 
> === message truncated ===
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> --------------------~--> 
> $4.98 domain names from Yahoo!. Register anything. 
> http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/1U_rlB/TM
> --------------------------------------------------------------
> ------~-> 
> 
> -----
> To unsubscribe send a message to: 
> [EMAIL PROTECTED]
> -or-
> visit http://groups.yahoo.com/group/svg-developers and click 
> "edit my membership"
> ---- 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to