Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old August 3rd, 2011, 01:38 AM
Registered User
Join Date: Aug 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML to CSV


I have the following XML file (exported from nessus) and I want to convert it to CSV format.

<?xml version="1.0" ?>
<pluginName>Hydra: PostgreSQL</pluginName>
<fullName>Hydra: PostgreSQL[entry]:Database name (optional) :</fullName>
<preferenceName>Database name (optional) :</preferenceName>
<FamilyName>MacOS X Local Security Checks</FamilyName>
<Report name="internal_all_nessus">
<ReportHost name=""><HostProperties>
<tag name="HOST_END">Tue Jun 28 14:25:11 2011</tag>
<tag name="mac-address">00:15:f9:f8:b0:27</tag>
<tag name="host-ip"></tag>
<tag name="host-fqdn">SIP0015F9F8B027.lan</tag>
<tag name="HOST_START">Tue Jun 28 14:20:24 2011</tag>
<ReportItem port="23" svc_name="telnet" protocol="tcp" severity="0" pluginID="0" pluginName="" pluginFamily=""/>
<ReportItem port="5060" svc_name="sip" protocol="udp" severity="1" pluginID="21642" pluginName="Session Initiation Protocol Detection" pluginFamily="Service detection">
<solution>If possible, filter incoming connections to the port so that it is
used by trusted sources only.</solution><risk_factor>None</risk_factor><description>The remote system is running software that speaks the Session
Initiation Protocol.

SIP is a messaging protocol to initiate communication sessions between
systems. It is a protocol used mostly in IP Telephony networks /
systems to setup, control and teardown sessions between two or more
systems.</description><plugin_publication_date>2003/12/29</plugin_publication_date><synopsis>The remote system is a SIP signaling device.</synopsis><plugin_type>remote</plugin_type><see_also>http://en.wikipedia.org/wiki/Session_Initiation_Protocol</see_also><plugin_modification_date>2011/03/07</plugin_modification_date><plugin_output>
The remote service was identified as :


It supports the following options :

<plugin_version>$Revision: 1.18 $</plugin_version></ReportItem>

The .csv must llok like this:

Host,Synopsis,Description,Solution,Risk Factor,PluginID
... ... ... ... ... .. ..

My main problem is that certain tags (the <Report item> tag) contain some attributes and I need to the "value" of the attributes in my .csv file. I am a bit confused since I am new with xsl but it is urgent for to accomplish the transformation as soon as posible.

Any help is welcome :)

Thank you
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert XML to CSV with XML field names as column headers? swheeler XSLT 10 February 10th, 2012 10:18 AM
XML to CSV: Transformation asearle XML 0 March 19th, 2010 07:51 AM
CSV and XML with PHP NEO1976 PHP How-To 1 July 17th, 2006 02:33 AM
XML to CSV reloader2 XML 2 September 7th, 2005 08:51 AM
convert xml to csv woofy77 XSLT 0 December 8th, 2003 01:05 AM

All times are GMT -4. The time now is 09:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.