Keeping XML Tags in XSL

27 February 2009
by Gavin Colborne

Problem
In your XSL you want to grab an XML document “as is” but the XSL keeps stripping the XML tags and only returning data values to you.
My LiveSite Component was connecting to a XML WebService and in one case I only wanted to retrieve all the XML and return it to my XSL.
I was struggling as the XSL was removing all the tags and leaving just the contents of the tags.
Here is what I did:
Solution
Use XSL Copy – your XSL should look like:


Important
You must set your Page Settings to “XML” in order to see this correctly – you will not be able to Preview correctly in the LiveSite component development branch as you have no control over the page settings here.

Our Latest News