Mega Code Archive

 
Categories / XML / XSLT StyleSheet
 

Output html img tag

File: Data.xml <xdata> </xdata> File: Transform.xslt <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"   version="1.0">   <xsl:output method="xml" omit-xml-declaration="yes" />   <xsl:template match="xdata">     <section>       <xsl:element name="author">         <xsl:attribute namespace="http://www.w3.org/1999/xlink"           name="type">simple</xsl:attribute>         <xsl:attribute namespace="http://www.w3.org/1999/xlink"           name="href">a.html</xsl:attribute>       </xsl:element>       <xsl:apply-templates />     </section>   </xsl:template> </xsl:stylesheet> Output:    <section><author xmlns:ns0="http://www.w3.org/1999/xlink" ns0:type="simple" ns0:href="a.html"/> </section>