xml to csv using xslt - download the result -


i've got xml file in following format

<result_set>     <results>         <review>             <byline>name</byline>             <display_title>title</display_title>             <mpaa_rating>r</mpaa_rating>             <publication_date>2014-1-1</publication_date>             <headline>text</headline>             <summary_short>summary</summary_short>        </review>    </results> </result_set> 

and xsl follows:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" indent="yes"/>    <xsl:template match="/">     <html>     <body>           <xsl:for-each select="result_set/results/review">             <div>                 <xsl:value-of select="byline"/>,<xsl:value-of select="display_title"/>,<xsl:value-of select="mpaa_rating"/>,<xsl:value-of select="publication_date"/>,<xsl:value-of select="headline"/>,<xsl:value-of select="summary_short"/>             </div>         </xsl:for-each>       <xsl:apply-templates/>     </body>     </html>   </xsl:template> 

the information displays on html page fine, wondering if there better way of writing xsl. that, want user able download csv file. how can this?


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -