Topic
  • 3 replies
  • Latest Post - ‏2012-10-02T05:12:35Z by SystemAdmin
badbetty
badbetty
2 Posts

Pinned topic Xform instance data deliberation

‏2012-08-23T16:41:08Z |
what are the advantages/disadvantages on using inline, src and resource instance data ?


for some reason after a few years of enjoying xforms - particularly within XRX - for some reason i sat and asked a question to myself of why would i choose to use the 'src' attribute for instance data over 'inline'.

I was addressing a problem of having to create an xform dynamically to edit xml data based on a previous search and pick operation (for the xml data required) and i had the xquery create the xform using the src attribute linking to the previously chosen xml data (stored as individual xml 'records' in the Db).

The xform would be returned to the browser's xform processor and then another (wasteful?) request be issued to go get the instance using the src.

So, if generating the xform why not just include the inline instance and send it all at once.

I could be missing some tricks but in any case I would like some opinions etc on my above question please.
Thank you
Updated on 2012-10-02T05:12:35Z at 2012-10-02T05:12:35Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    265 Posts

    Re: Xform instance data deliberation

    ‏2012-08-24T13:30:48Z  
    Choosing between @src or inline, you should consider whether, for a client-side XForms implementation, the instance might already be stored in the client cache. Because some instances are read-only ones, it's a "less HTTP requests vs. shorter HTTP responses" choice.

    XForms preprocessing at server-side is an interesting possibility: resolve @src (even cross-domain ones!), interpret static controls (some output controls, itemsets). An extra attribute such as @runat="server" could help locating what to be done. XSLT 1.0 is not powerful enough to dynamically evaluate XPath expressions but many XSLT engines allow to define extensions in some programming language.

    What do you think?

    -Alain
  • badbetty
    badbetty
    2 Posts

    Re: Xform instance data deliberation

    ‏2012-08-26T12:53:06Z  
    Choosing between @src or inline, you should consider whether, for a client-side XForms implementation, the instance might already be stored in the client cache. Because some instances are read-only ones, it's a "less HTTP requests vs. shorter HTTP responses" choice.

    XForms preprocessing at server-side is an interesting possibility: resolve @src (even cross-domain ones!), interpret static controls (some output controls, itemsets). An extra attribute such as @runat="server" could help locating what to be done. XSLT 1.0 is not powerful enough to dynamically evaluate XPath expressions but many XSLT engines allow to define extensions in some programming language.

    What do you think?

    -Alain
    @Alain

    Thank you for your experienced views. I will have a think about your last point regarding server side! I didn't quite understand it fully so perhaps you could expand some more please - thank you :)

    Chris
  • SystemAdmin
    SystemAdmin
    265 Posts

    Re: Xform instance data deliberation

    ‏2012-10-02T05:12:35Z  
    • badbetty
    • ‏2012-08-26T12:53:06Z
    @Alain

    Thank you for your experienced views. I will have a think about your last point regarding server side! I didn't quite understand it fully so perhaps you could expand some more please - thank you :)

    Chris
    Advantages of using macro and inline functions is Macros and Inline functions are efficient than calling a normal function. The times spend in calling the function is saved in case of macros and inline functions as these are included directly into the code.

    electronics stores nz