posted at codeguru, developerWorks, wrox, javaranch, Hi, I have one XML file like below. I put only one node for Document below. I want to use XSL to display the XML as it is. Means I want to display the XML as HTML such that on the browser it looks like XML.
You want to display XML as XML in browser but using XSL, is that right ? if so The xsl funtion name(), will get you the element name, then you can use & lt; and & gt; to display the complete tag something like
Hi Balaji, I want to do that for all the elements. Is there any gener XSL for that. Hi Madhav, With xsl:copy I am getting the data but not the < and > tags. Satya
author and deputy
Joined: Jul 13, 2001
Originally posted by Madhav Lakkapragada: Balaji, Isin't it easy to use the xsl:copy, instead. Just for discussions sake...
Hi Madhav, You are right!..the task can be done easily by using xsl:copy and xsl:copy-of , xsl:copy copies only the current node whereas xsl:copy-of copies the current with all its descendents, BUT THEN it is not possible to display the output tree in the broswer as it will contain xml tags. Shekar: Regarding the generic XSL, i don't have anything readily available, one idea could be to write a recursive template with xsl:if to check whether there is child node exists for a give root element if so print it and move to next if exist. , big work right ??