Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 5th, 2011, 12:30 AM
Registered User
 
Join Date: Aug 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Cool XML to CSV transformation

I have made the following code to test some output from my XML. I have to convert XML to .csv .

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>

<xsl:template match="/">
<xsl:value-of select="NessusClientData_v2/Report/ReportItem/@pluginID"/>
<xsl:if test="position() != last()">
<text>,</text>
</xsl:if>
</xsl:template>



</xsl:stylesheet>

Please, can anyone tell what he/she believes that this code will do?? I want to take the "pluginID" attribute from all the "ReportItem" elements and put them to the .csv .

If anyone has any suggestions I would be gratefull since I am a nube with this stuff...

Thank you in advance.





Similar Threads
Thread Thread Starter Forum Replies Last Post
XML to CSV: Transformation asearle XML 0 March 19th, 2010 07:51 AM
Regarding xml-html transformation of an xml string using xslt and javascript suprakash444 XSLT 1 January 12th, 2009 01:23 AM
XSL transformation - PIPE delimited to CSV satish9 XSLT 3 June 11th, 2007 10:21 AM
Is XML supports transformation of HTML to XML? zeeonline XSLT 1 July 28th, 2006 05:13 PM
Nested XML to CSV transformation 2Poc XSLT 2 September 19th, 2005 03:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.