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

RE: concatenating user input and special characters

From: Mark Seaborne <MSeaborne@origoservices.com>
Date: Tue, 3 Dec 2002 13:56:00 -0000
Message-ID: <DC65AE678B89004B9CCB202E19482CC704FB92@mail.origoservices.local>
To: "Roman Huditsch" <roman.huditsch@hico.com>, <www-forms@w3.org>

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 08:56:14 GMT

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