xi:include in header to load external javascripts

classic Classic list List threaded Threaded
3 messages Options
DL
Reply | Threaded
Open this post in threaded view
|

xi:include in header to load external javascripts

DL
xi:include line placed in <head></head> does not appear to allow inclusion of raw code (such as dynamically created javascript).

I've tried adding xi:include attribute parse="text" .. but that causes an error.

So to my question .. can <xi:include be used in xform view.xhtml to include in header external javascripts which are dynamically generated by php on a remote apache server?
Reply | Threaded
Open this post in threaded view
|

Re: xi:include in header to load external javascripts

Erik Bruchez
Administrator
> xi:include line placed in <head></head> does not appear to allow inclusion of
> raw code (such as dynamically created javascript).
>
> I've tried adding xi:include attribute parse="text" .. but that causes an
> error.
>
> So to my question .. can <xi:include be used in xform view.xhtml to include
> in header external javascripts which are dynamically generated by php on a
> remote apache server?

Not at this time. Our XInclude implementation can only source XML files.

But even if you were to do this, unless good caching is implemented,
the result wouldn't be very efficient.

Can't you just include the file from the client with a <script src="...">?

-Erik


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
DL
Reply | Threaded
Open this post in threaded view
|

Re: xi:include in header to load external javascripts

DL
This post was updated on .
Can't you just include the file from the client with a <script src="...">?
This only loads static js files.

...

I've found several articles on creating dynamic js and css by php ...

http://www.dynamicdrive.com/forums/showthread.php?t=21617

http://www.javascriptkit.com/javatutors/externalphp.shtml

http://azure-dev.kiao.net/17-dynamic-javascript-or-css-in-php

However instead of applying above techniques I've found that I can move all of my preprocessing logic back to the apache/php5 server and to echo xhtml (the dynamic xform definition) back to Form Runner.

In any test app (containing page-flow.xml and view.xhtml files)  the view path in page-flow.xml can point to the remote view.php (returning xhtml content) instead of the usual local view.xhtml.

<page path-info="/xforms-bookcast-test/" view="http://localhost/xforms-inc/view/view.php" />

So now the xform definition running in orbeon form runner can be created and dynamically changed on a remote apache/php5 server.