logo       

proposal: attribute value templates for XForms URIs: msg#00029

Subject: proposal: attribute value templates for XForms URIs
hi *,

Uli and me discussed the following idea some days ago and like to share it here on the list for feedback.

one of the most frequent questions about Chiba is how to parameterize URIs that are used for loading and sending data.

while this is possible by API with chibaBean.setInstanceURI or preprocessing we found another solution that might be much more elegant and flexible.

consider the following example:

<xf:instance xf:src="http://{context('host')}/{context('path'}/{context('document')}" />

let me explain: the syntax follows the same lines as xslt; whenever a pair of '{}' are found the contents is evaluated as expression and the result of this is returned into the attribute value.

let context() be a newly defined xpath function which reads values from the new ChibaContext class.

so for the imaginary values in ChibaContext

host=myhost
path=somepath
document=sometext

the URI would be resolved to

<xf:instance xf:src="http://myhost/somepath/sometext"; />

although this is quite the same as building the string in your app and pass it with setInstanceURI, this method is more descriptive and offers other exciting uses.

another example:
<xf:instance xf:src="http://{instance-value('default-instance',/data/host)}" />

by implementing another xpath function 'instance-value' one might get access to instance-data values in the URI. so for an instance like this

<xf:instance id="default-instance" xmlns="">
  <data>
    <host>www.google.com</com>
  </data>
</xf:instance>

this function would take an instance id as first argument and the xpath as second and return the value. the evaluated result would be:

<xf:instance xf:src="http://www.google.com"; />

the overall mechanism is simply substituting all occurrences of bracketed expressions with the xpath evaluated results of whatever is defined in the brackets. so sure functions can also be mixed:

<xf:instance xf:src="http://{instance-value('',/data/host)}/login?user={context('user-name')}" ...
/>

of course it must be clearly mentioned that this isn't XForms standard but nevertheless in our eyes a very interesting one.

implementation could reside in the abstract superclass for all connectors so every specific protocol would benefit some these automatically.

interested in your opinions...


Joern






-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe