XSLT / XPath function to remove trailing characters -


i have situation whereby displaying address in xform, address comes me pre formatted, contains couple of trailing commas, need remove.

here code:

    <xf:output id="address-control" ref="$address" >         <xf:label>gp address</xf:label>     </xf:output> 

which, produces output this:

 house, road, town, , , , , 

i need strip out trailing commas output becomes:

 house, road, town 

thanks in advance

using replace($address, '[\s,]+$', '') should remove trailing mix of white space , commas.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -