473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Extracting Data from XML using XSL

gpraghuram
1,275 Expert 1GB
Hi,
I want to know how to extract information from a XML file using a XSL style sheet using perl.
I have alreday written a XSL for a XML file.
My requirement is to apply this XSL on the xml which in turn gives me a csv output.
Which module shuld i use for this?
Thanks
Raghu
Nov 10 '09 #1
5 2912
Frinavale
9,735 Expert Mod 8TB
I'm not very familiar with many Perl modules but the logic behind this doesn't seem that hard.

CSV files are just files containing comma-separated values.
You could use the XSL to transform the XML into comma-separated values and then just output this to a csv file.

Upon doing a quick google search on the topic turned up a lot of examples...most of them weren't using Perl but since this is mostly about using XML (and XSL) to produce comma-separated values....it seems like it shouldn't be too hard to apply this to Perl.

Googling also revealed that you're going to need to use the XML::XSLT and XML::DOM modules.



-Frinny
Nov 13 '09 #2
numberwhun
3,509 Expert Mod 2GB
And if you want to get really freaky with your CSV file creation, you can use the DBD::CSV module, which allows you to treat a csv file as a database.

Also, simply search on the CPAN site for CSV and you will find other modules for reading/writing CSV files.

Regards,

Jeff
Nov 17 '09 #3
Frinavale
9,735 Expert Mod 8TB
That module sounds awesome numberwun!

:)

Hope it helps the OP
Nov 17 '09 #4
gpraghuram
1,275 Expert 1GB
Hi,

Thanks for the suggestion.
I was able to use XML::XSLT to achive this.

Thanks
Raghu
Nov 25 '09 #5
numberwhun
3,509 Expert Mod 2GB
Glad that it worked for you Raghu.
Nov 25 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steve | last post by:
Hi, I have a very long string, someting like: DISPLAY=localhost:0.0,FORT_BUFFERED=true, F_ERROPT1=271\,271\,2\,1\,2\,2\,2\,2,G03BASIS=/opt/g03b05/g03/basis,...
5
by: Michael Hill | last post by:
Hi, folks. I am writing a Javascript program that accepts (x, y) data pairs from a text box and then analyzes that data in various ways. This is my first time using text area boxes; in the past,...
1
by: v0lcan0 | last post by:
Any help on extracting the time part from the datetime field in SQL database. even though i had entered only the time part in the database when i extract the field it gives me only the date...
3
by: Alfred | last post by:
Hi I would like to extract only 15 records at a time from the backend in alfabetic order. Click on a button and then the next 15. Reason data must come over a 56k modem. The data is not...
0
by: Nadav | last post by:
Hi, Introduction: *************************** I am using the MSI API to extract MSI embedded files, I do this by iterating through all of the records in the ‘_Streams’ table and dumping...
2
by: Dickyb | last post by:
Extracting an Icon and Placing It On The Desktop (C# Language) I constructed a suite of programs in C++ several years ago that handle my financial portfolio, and now I have converted them to...
0
by: runner7 | last post by:
I used file_get_contents() to read a pdf into a string and then tried to extract the encoded part between the "stream" and "endstream" words using the strpos() and substr() functions. (I could not...
0
by: sgsiaokia | last post by:
I need help in extracting data from another source file using VBA. I have problems copying the extracted data and format into the required data format. And also, how do i delete the row that is not...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
1
by: JSagar | last post by:
Hello Expert ! I am new to python , i had done 'C' Code , which extracted file data , But i don't want to give my exe On remote side. Following thing is it Possible using python? -...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.