Click to See Complete Forum and Search --> : Replacing spaces with break tags


sylenceone
02-02-2009, 10:36 AM
Hi,

I have the following xml element in which I want to replace the space with "<br/>" tags:

<Field name="salescode">01-Inside 08-Inside 12-Inside IZ-House</Field>

I have an xslt with the following line of code:

<xsl:value-of select="Field[@name='salescode']"/>

I know I'm suppose to use the Replace function, but how would I go about using it? Thanks.

Charles
02-02-2009, 11:10 AM
In XSLT you're working with the elements themselves and not the tags that commonly describe them. You can't insert an element into a string like you can insert a tag. You have to break up string and then assemble the parts around the BR elements. See http://www.xml.com/lpt/a/1405 for more.