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