Turning XSLT into a simple HTML snippet.

Posted by jaasum on Stack Overflow See other posts from Stack Overflow or by jaasum
Published on 2010-03-08T02:00:15Z Indexed on 2010/03/08 2:12 UTC
Read the original article Hit count: 868

Filed under:
|

http://drp.ly/yeAex

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="/data/tour/entry">
  <img src="{filename}"/>
  <h2>{heading}</h2>
  {description}
 </xsl:template>
</xsl:stylesheet>

Here is the code I am working with. I am a newbie to XSLT and I suppose I am not understanding how it transforms my XML into HTML entirely. This snippet of code I plan on loading via AJAX, so I really all I need it to output is a blank html document consisting only of these three items.

I realize I am omitting the xsl:output tag and that is because I really don't understand how I can get this to just simply match that information to my tags in my xml without adding , tags etc. All it outputs is a string of text in an html document.

© Stack Overflow or respective owner

Related posts about xslt

Related posts about Xml