Re: AW: concatenating user input and special characters

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 UTC