W3C home > Mailing lists > Public > www-forms@w3.org > December 2002

Re: AW: concatenating user input and special characters

From: Mikko Honkala <honkkis@tml.hut.fi>
Date: Tue, 03 Dec 2002 16:15:55 +0200
Message-ID: <3DECBC9B.6080606@tml.hut.fi>
To: Roman Huditsch <roman.huditsch@hico.com>
CC: Mark Seaborne <MSeaborne@origoservices.com>, www-forms@w3.org

Hi,

you will probably get into all sorts of funny situations with that, 
since in effect you are creating dynamic dependencies between fields, 
which is not allowed.

One solution is to point to all applicable nodes with the "nodeset" 
attribute and use the if() function. (in other words, move the test to 
the calculate from the binding).

Or, you could disallow using the # character in the string with a schema 
constraint and always add it using calculate or setValue.

-mikko

Roman Huditsch wrote:
> Hello,
> 
> So I assume that 
> 
> <xfm:bind nodeset="//@xlink:href[starts-with(., '#') = false]" calculate="concat('#', .)"/>
> 
> does the same for every attribute xlink:href within my whole xforms instance, right?
> Thanks for the help.
> 
> wbr,
> Roman
> 
> -----Ursprüngliche Nachricht-----
> Von: Mark Seaborne [mailto:MSeaborne@origoservices.com]
> Gesendet: Dienstag, 3. Dezember 2002 14:56
> An: Roman Huditsch; www-forms@w3.org
> Betreff: RE: concatenating user input and special characters
> 
> 
> Hi
> 
> My suggestion below really is a guess on my part, so if I am wrong I hope someone will say so!
> 
> It is probably not what you had in mind, but you could try something like:
> 
> 	<xfm:bind nodeset="xlink:href[starts-with(., '#') = false]" calculate="concat('#', .)"/>
> 
> I just tried this out in X-Smiles and it had the effect of adding the '#' character to the start of any element's value not already starting with '#'.  Under some circumstances a second '#' does get added, but I am unsure whether this is due to my code, or a bug in X-Smiles!
> 
> If you wanted to hide the # character, then this doesn't do the job (it just means that the user doesn't have to remember the # character), and I can't think of anything that does, off hand. You could always just forget the # character altogether, and do a bit of post-processing (via XSLT or whatever). 
> 
> All the best
> 
> Mark
> 
> -----Original Message-----
> From: Roman Huditsch [mailto:roman.huditsch@hico.com]
> Sent: 03 December 2002 09:19
> To: www-forms@w3.org
> Subject: concatenating user input and special characters
> 
> 
> Hello again,
> 
> I need to add XLink information to my xforms instance data like 
> 
> <xforms:instance>
>     ...
>     <link xlink:href="#website"/>
>     ...
> </xforms:instance>
> 
> whereas the "website"-part should be the input of the user. How can I attach the "#" character to this information? 
> 
> wbr,
> Roman
Received on Tuesday, 3 December 2002 09:11:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:54 GMT