Re: is XForms suitable for my problem ?

LEBUR Guillaume wrote:

>I use a tool that automatically generates a DocBook XML file describing
>a document tree structure. The resulting DocBook file takes the form of
>an <article>, with <section>'s corresponding to folders in the tree and
><ulink>'s to documents in each folder. The number of folders and
>documents is virtually unlimited.
>
> 
>
>What I'd like to do is make an XForm that would be used to edit things
>in the Docbook file once it has been generated, like the title of the
>article, the order of the ulinks, etc.
>
>I'd like to know if Xforms is well-suited for my needs, namely :
>
> 
>
>-         Based on the DocBook file, generating a form with fields such
>as the title, date, author, plus a list of all the folders and documents
>with buttons to re-arrange their order.
>
>-         Upon validation, applying the modifications to the DocBook
>file.
>
> 
>
> 
>
>The underlying question is actually : "Is an XForm able to take its data
>from a XML file containing an undefined number of similar elements (in
>my case, <section>'s and <ulink>'s), and to turn them into an undefined
>number of form controls ?"
>  
>

The short answer: Yes. The long answer is that XForms includes 
structures for repeating elements via the "repeat" element, and this can 
be nested. However, there are matters which may complicate things. 
AFAIK, there is no way to have a dynamic amount of /levels/ of repeats, 
so you could run into problems if e.g. "section" elements have no limit 
on nesting, as follows:

<section>
    <section>
       <section>
          ...more sections...
       </section>
    </section>
</section>

Also, if your XML document is very large, some XForms processors might 
bog down too much to be usable. Your XForms should probably be checked 
for speed as soon as possible, with one of your larger files, to see if 
this can become a problem. Just 2 cents from my experience with Chiba:

    * Horrendously (and unneccessarily) long/complex XPaths (300-400
      lines) did /not/ bog down the XForms
    * Large instance data (well, around 25kb) bogged down the XForms to
      loading times around 7 seconds for each action
          o In my case, the solution was to put the read-only instance
            data in a separate model. Then the startup time was about
            the same, but interactions took much less than a second.

HTH :-)

-- 
Victor Engmark
"Quid quid latine dictum sit, altum viditar" - "What is said in latin, 
sounds profound"

Received on Thursday, 31 March 2005 09:16:14 UTC