Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 11th, 2008, 02:34 AM
Authorized User
 
Join Date: Jul 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to vsempoux
Default replace equal charachter(=) in tag

Hello,

How can i replace all the = chars in a tag with ; ?

Thanks in advance

 
Old July 11th, 2008, 02:48 AM
Authorized User
 
Join Date: Jul 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to vsempoux
Default

Found it already myself.
The function translate is doing the trick.
translate(tag,'=',';') -> to change all = to ;

Greetings

 
Old July 11th, 2008, 03:38 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You mean you want to replace

<a b="c"/>

with

<a b;"c"/>

? You can't do that: the output has to be well-formed XML.

Oh, I guess by "inside a tag" you probably mean "between a start tag and an end tag" - for example <a>xxxxx = yyyyy</a> becomes <a>xxxxx ; yyyyy</a>. It really does make things simpler if you use terms correctly. That "=" sign is not inside a tag.

The answer is simple: use the translate function

<xsl:value-of select="translate(., '=', ';')"/>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
INNER JOIN Not EQUAL rylemer Access VBA 3 May 8th, 2017 01:35 AM
HTML tag from C# or ASP.NET tag from javascript angshujit ASP.NET 2.0 Basics 3 February 16th, 2007 10:07 AM
Chapter 10: Case Delete charachter sagh BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 August 1st, 2005 04:55 PM
charachter counting bjackman Access 12 March 11th, 2005 04:51 AM
Multiple Not Equal rylemer Access 5 January 23rd, 2004 04:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.