Hi Mike, This is a great question. We did think of generating the UI module from html fragment when we started to work on trump, but later on had to give up this idea simply because the html is way too verbose to use as the direct input for UI module generator. Instead, in trump, we ask users to click on the elements they want to include, get the xpaths for the elements and then reconstruct the tree, which is a prefix tree, based on their xpaths. The generated tree is a UI module. Of course, they are many other ways to generate the UI module.
The algorithm is described in the following wiki page. http://code.google.com/p/aost/wiki/UIModuleGeneratingAlgorithm Actually, I implemented the algorithm in Java first, then convert it to Javascript because it was easier to debug in Java. The Java code still lives under the package org.telluriumsource.trump (src/test/groovy) in the trunk/core project. You can take a look if you are interested. The UI module generating algorithm itself is not very complicated, but the difficult part will be how to extract a html skeleton from a html fragment, then generate the UI module from the html skeleton. Let us know how far you can get. Thanks, Jian On Sat, Jan 23, 2010 at 8:32 PM, Mike <[email protected]> wrote: > Is there a utility to take an HTML fragment and output the ui module > groovy code? > > This is what trump does - but is the code available by itself? > > My idea is to annotate the html with id's matching a naming > conventions then walk the html and gen the module code. > > The nodes in the ui model would be made up of the nodes with id's that > match the naming convention. > > If there isn't I'm going to write it. > > Thanks, > > Mike > > -- > You received this message because you are subscribed to the Google Groups > "tellurium-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<tellurium-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/tellurium-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "tellurium-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en.
