Hi,
I'd like to question this section of the XForms NG doc: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 7.2. External Instances This is done with the src attribute on the xforms:instance element, for example: <xforms:instance src="my-instance.xml"/> With a client-side implementation of XForms, it makes sense for the src attribute to be relative to the base URI of the XForms page, which is usually an http: URI. With a server-side implementation, it may make more sense in general to interpret the URI relative to the location of the source XForms page, which is usually an oxf: URI. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ If we want to maximize the interoperability with other XForms implementations, I think that on the contrary it would make sense to interpret relative URIs with a base URI that would be the base of the XForms page. That would also have the benefit to be coherent with the URIs used in submissions. I am trying right now to write an application that dissociates the definition of a XForms document and the definition of its instance. The definition of the page is: <page path-info="/sandbox/query" view="query.xhtml"/> >From an application developer point of view, this is a static XHTML/XForms page. The definition of the instance is: <page path-info="/sandbox/query-instance" model="query-instance.xpl"/> query-instance.xpl sends a default document if the instance is null and sends an updated instance back if that's not the case. In my XForm, the submission is defined as: <xforms:submission id="query" method="post" replace="instance" action="/sandbox/query-instance" ref="instance('query-instance')"> IMO, the src attribute should mirror that behavior (it's just a matter of posting a GET to the same resource where a POST is sent during the submission) and we should be able to write: <xforms:instance src="/sandbox/query-instance" id="query-instance"/> With the current behavior, I haven't found any other way achieve the same effect than to write: <xforms:instance src="http://localhost:7777/orbeon/sandbox/query-instance" id="query-instance"/> which seems to be working but is quite ugly! Thanks, Eric -- Curious about Relax NG? Read my book online. http://books.xmlschemata.org/relaxng/ ------------------------------------------------------------------------ Eric van der Vlist http://xmlfr.org http://dyomedea.com (ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax (W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema ------------------------------------------------------------------------ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Eric,
I don't disagree with your reasoning below. In fact, right now, we assign a (virtual, i.e. outside the document) xml:base to the XForms page which equates to the external URL used to retrieve it. This is used for the moment only by xforms:load, but will (should) be used by other XForms constructs in the future. For xforms:instance/@src, the default could be the most cross-platform solution, i.e. the one outlined here, but you could possibly have an option to override this. At any rate, even without that, you would be able to us the "oxf:" protocol to access something server-side, with the drawback that you must then use an absolute path, e.g.: <xforms:instance src="oxf:/my/initial/instance.xml"/> -Erik Eric van der Vlist wrote: > Hi, > > I'd like to question this section of the XForms NG doc: > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 7.2. External Instances > This is done with the src attribute on the xforms:instance element, for > example: > > > <xforms:instance src="my-instance.xml"/> > With a client-side implementation of XForms, it makes sense for the src > attribute to be relative to the base URI of the XForms page, which is > usually an http: URI. > > > With a server-side implementation, it may make more sense in general to > interpret the URI relative to the location of the source XForms page, > which is usually an oxf: URI. > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > If we want to maximize the interoperability with other XForms > implementations, I think that on the contrary it would make sense to > interpret relative URIs with a base URI that would be the base of the > XForms page. > > That would also have the benefit to be coherent with the URIs used in > submissions. > > I am trying right now to write an application that dissociates the > definition of a XForms document and the definition of its instance. > > The definition of the page is: > > <page path-info="/sandbox/query" view="query.xhtml"/> > >>From an application developer point of view, this is a static > XHTML/XForms page. > > The definition of the instance is: > > <page path-info="/sandbox/query-instance" model="query-instance.xpl"/> > > query-instance.xpl sends a default document if the instance is null and > sends an updated instance back if that's not the case. > > In my XForm, the submission is defined as: > > <xforms:submission id="query" method="post" replace="instance" > action="/sandbox/query-instance" > ref="instance('query-instance')"> > > IMO, the src attribute should mirror that behavior (it's just a matter > of posting a GET to the same resource where a POST is sent during the > submission) and we should be able to write: > > <xforms:instance src="/sandbox/query-instance" > id="query-instance"/> > > > With the current behavior, I haven't found any other way achieve the > same effect than to write: > > <xforms:instance src="http://localhost:7777/orbeon/sandbox/query-instance" > id="query-instance"/> > > which seems to be working but is quite ugly! > > Thanks, > > Eric > > > ------------------------------------------------------------------------ > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |