I have an Umbraco 4.7 site that has an XSLT that pulls through an XML feed, the problem is my XML feed needs a bit of cleaning up because it contains lots of that I do not need. I have tried using the replace function but I think it doesn't work because the are together like this &nbps;
Does anyone know how I can clean this up? This is an example of the feed:
<p>Pink Floyd, McCartney, Daltrey<br /> thrashing their ghosts for charity.<br /> And how we remember.<br /> How the pledges pour in.<br /> <br /> (how the ghosts inside us all<br /> & nbsp; tap their feet,<br /> & nbsp; click their bones)<br /> <br /></p>
This is the XSLT I have tried so far but it does not work:
Cleaning up an XML feed, removing
Hi all,
I have an Umbraco 4.7 site that has an XSLT that pulls through an XML feed, the problem is my XML feed needs a bit of cleaning up because it contains lots of that I do not need. I have tried using the replace function but I think it doesn't work because the are together like this &nbps;
Does anyone know how I can clean this up? This is an example of the feed:
<p>Pink Floyd, McCartney, Daltrey<br /> thrashing their ghosts for charity.<br /> And how we remember.<br /> How the pledges pour in.<br /> <br /> (how the ghosts inside us all<br /> & nbsp; tap their feet,<br /> & nbsp; click their bones)<br /> <br /></p>
This is the XSLT I have tried so far but it does not work:
<xsl:variable name="briefText" select="umbraco.library:StripHtml(articleMainText)"></xsl:variable> <xsl:variable name="cleanText" select="umbraco.library:Replace($briefText, ' ', '')"></xsl:variable>
Hi trfletch,
Because the way the ampersand works in XML, when you replace, you really need to write the replace like this:
If that doesn't work, we might need to look at what you get from the StripHtml() method ...
EDIT: Forgot a semicolon - hope the edit works...
/Chriztian
Hi Criztian,
Thank you very much for the quick response, that worked perfectly.
Regards
Tony
is working on a reply...