Re: SVG and XForms

Alain,

Nice work!

SVG is a really good option if you need vector graphics, and being able to make the graphics dynamic based on user data is really neat, and give another dimension to your documents. We use XSL+FO+SVG to generate dynamic diagrams/charts/drawings, so I'm completly convinced that XForms+SVG is also very powerful and useful.

I have a couple small remarks though:

1. Repeat on numbers: In XForms 2.0 we adopt XPath 2.0 and there you can create sequences of numbers using the to operator[1], which allows you to write <xf:repeat ref="1 to 5">  (the current context inside the repeat will hold the atomic value of the current iteration)

2.  The var element: If you go to [2] you can read that 'variables can occur either as a child of an action element or somewhere in the document except the model.' with other words variables can occur every where in the document if they are a descendant of an action element or if the are *not* a descendant of the model. There is an editorial note in the spec 'Currently we don't support variables inside the model outside actions, we are waiting for more implementation experience before allowing this.' so if you want to experiment with this please feel free to do it and share your experience. There are currently two possibilities for scoping variables inside the model (available throughout the whole document if the current evaluation context is associated with that model, or only for all following siblings and their descendants)

Kind regards,

Nick Van den Bleeken
R&D Manager

Phone: +32 3 425 41 02
Office fax: +32 3 821 01 71
nick.van.den.bleeken@inventivegroup.com
www.inventivedesigners.com


1: http://www.w3.org/TR/xpath-functions/#func-to
2: http://www.w3.org/MarkUp/Forms/wiki/XForms_2.0#The_var_element

On 02 Apr 2012, at 23:31, Alain Couthures wrote:

> Hello,
>
> I have recently embedded XForms controls within SVG images to
> dynamically render data.
>
> For chart axes, I needed a repeat group based on numbers not on nodes so
> I added an extension to XSLTForms: repeat/@from, repeat/@to and
> repeat/@step. The loop index can be obtained with the "." XPath
> expression so the context is not in any model and the instance()
> function has always to be used when referring to nodes.
>
> For pie charts, I needed trigonometric functions, which are only
> available in XPath 3.0, but are already supported by XSLTForms.
>
> For performance, I used an intermediate instance with calculated
> bindings. I might have implemented the new 'var' element but initially
> get confused with the 2.0 specs whether vars were limited to function
> bodies or not.
>
> AVT support is, of course, very important for SVG but I also used output
> controls within text elements. I am not sure that labels in XForms group
> controls can easily be rendered in SVG.
>
> Here are some online examples:
> http://www.agencexml.com/xsltforms/flags.xml,
> http://www.agencexml.com/xsltforms/piechart.xml,
> http://www.agencexml.com/xsltforms/gauges.xml and
> http://www.agencexml.com/xsltforms/gantt.xml.
>
> I would be happy to have your opinions about SVG and XForms.
>
> Thanks!
>
> -Alain
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>


________________________________

Inventive Designers' Email Disclaimer:
http://www.inventivedesigners.com/email-disclaimer

Received on Tuesday, 3 April 2012 09:21:48 UTC