Solved

XSL Replace string

Posted on 2013-01-10
2
284 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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
Find out what you should include to make the best professional email signature for your organization.
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 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