Output html img tag : html « XSLT stylesheet « XML

XML
1. CSS Style
2. SVG
3. XML Schema
4. XQuery
5. XSLT stylesheet
Java
XML Tutorial
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
XML » XSLT stylesheet » html 
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>
  

 
Related examples in the same category
1. Output various html tags
2. One html tag per template
3. Wrap HTML tags in template
4. Format output with HTML tags
5. Construct image name used by generated HTML in style sheet
6. html output method to make br tags come out as
7. Output html with frameset
8. Transformation of book information into XHTML with sorting
9. Output whole xhtml document
10. Add more format with html tags
11. Format output with font
12. Use blockquote to output value from xml
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.