Solved

XSL Replace string

Posted on 2013-01-10
2
285 Views
Last Modified: 2013-01-10
I'm getting data from a client
where they have three x'x in a row, they want a line break in the xslt

So
If my xml has
<SchoolCity>School NamexxxCIty Name</SchoolCity>

I need to output
School Name
City Name

This is my current xslt
<xsl:value-of select="SchoolCity" />
0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
nap0leon earned 500 total points
ID: 38763438
Depending on which level of XSLT you are using...

XSLT 1- Create a template that runs the replace function for you:
http://geekswithblogs.net/Erik/archive/2008/04/01/120915.aspx

XSLT 2- Use the replace() function:
http://p2p.wrox.com/xslt/45627-how-use-replace-function-xslt-2-0-a.html
0
 

Author Closing Comment

by:lrbrister
ID: 38763601
Perfect thanks
0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question