Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
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
Reply
 
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

Hello!!

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


<?xml version="1.0" ?>
<NessusClientData_v2>
<Policy>
<policyName>all</policyName>
<policyComments></policyComments>
<Preferences>
<ServerPreferences>
<preference>
<name>max_simult_tcp_sessions</name>
<value>unlimited</value>
</preference>
</ServerPreferences>
<PluginsPreferences>
<item>
<pluginName>Hydra: PostgreSQL</pluginName>
<pluginId>18660</pluginId>
<fullName>Hydra: PostgreSQL[entry]:Database name (optional) :</fullName>
<preferenceName>Database name (optional) :</preferenceName>
<preferenceType>entry</preferenceType>
<preferenceValues></preferenceValues>
<selectedValue></selectedValue>
</item>
</PluginsPreferences>
</Preferences>
<FamilySelection>
<FamilyItem>
<FamilyName>MacOS X Local Security Checks</FamilyName>
<Status>enabled</Status>
</FamilyItem>
</IndividualPluginSelection>
</Policy>
<Report name="internal_all_nessus">
<ReportHost name="10.0.0.80"><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">10.0.0.80</tag>
<tag name="host-fqdn">SIP0015F9F8B027.lan</tag>
<tag name="HOST_START">Tue Jun 28 14:20:24 2011</tag>
</HostProperties>
<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 :

Cisco-CP7960G/8.0

It supports the following options :

ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTE R,UPDATE
</plugin_output>
<plugin_version>$Revision: 1.18 $</plugin_version></ReportItem>
</ReportHost>
</Report>
</NessusClientData_v2>

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
Reply


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 06:57 PM.


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