• Get the Flash Player to see the slideshow.
  • Categories

  • Authors

  • Great Quotes

    Do not worry about your difficulties in Mathematics. I can assure you mine are still greater. — Albert Einstein

Get in touch...

To have a chat about
your CMS needs...

Call us 0207 193 2014
or
Email us on

Keeping XML Tags in XSL

February 27th, 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:

  <xsl:template match="/"> 
          <xsl:copy-of select="/"/> 
  </xsl:template>

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.

Leave a Reply

You must be logged in to post a comment.