How to get XML node value in XSLT?

How to access an exact XML node and not the value of it in an XSL stylesheet?

  • Ok, So in my XML file I have an image node: <img alt="Green arrow" src="green-arrow-up-icone-5011-48.png"/> Now I want to display this in my webpage using XSL: If I use <xsl:value-of select = "//img"/> (there is only one image), I don't get anything because the "value of" img is nothing as it has no nodes in it. How do I make XSL just take that node as it is and just display it on the webpage?

  • Answer:

    Use xsl:copy-of instead of xsl:value-of.

Seo Sanghyeon at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.