LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-09-2013, 06:25 AM   #1
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Rep: Reputation: Disabled
Transform xml to header file


Hi,
I would like to convert xml to c header file in Linux.

Can anyone help me.
 
Old 09-09-2013, 06:45 AM   #2
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,774

Rep: Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273
You need to specify first the format of the xml and the way, how do you want to construct that header file. Which language do you prefer? Do you have any plans or tries or sample program?
 
Old 09-09-2013, 06:50 AM   #3
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Hi pan64,
I had converted CSV to XML using a c++ program and in windows this xml is used to convert to c++ header file using msxsl.exe but this does not work in Linux.
Now, I have compiled the CSV2xml c++ program in Linux and am able to create XML file but now I want to convert this xml to c++ header file.
Here is some of my xml file content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Row>
<Error_code>20000</Error_code>
<Application>App</Application>
<Type>E</Type>
<Text>The page range selected for the %s report falls outside\nthe page range selected for the compared report.</Text>
<Output_Method>Format</Output_Method>
<Internal_ID___enumeration >IDS_PAGE_RANGE_SELECTED_FALLS_OUTSIDE_PAGE_RANGE_SELECTED_FOR_COMPARED_REPORT</Internal_ID___enumeration >
<File><path of file>\filename.cpp</File>
<Function>DifferenceReportDlg::OnOK() </Function>
<Source_Line_Number>288</Source_Line_Number>
</Row>
 
Old 09-09-2013, 07:00 AM   #4
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,774

Rep: Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273
have you tried wine?
 
Old 09-09-2013, 07:01 AM   #5
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Can you please help me with wine as am new in Linux
 
Old 09-09-2013, 07:05 AM   #6
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,774

Rep: Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273
wine is a package, you can try to install it. with wine you can run (some of) your windows programs on linux.
http://www.winehq.org/download/
 
Old 09-09-2013, 07:10 AM   #7
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks for the link.

How do we use it?
 
Old 09-09-2013, 07:15 AM   #8
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,774

Rep: Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273
it is documented on that site, so just look around. First you need to install it, and simply type wine <your windows program as usual>
 
Old 09-09-2013, 07:20 AM   #9
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
I tried to install but as I am having RHEL 4 and yum is by default not installed and we do not have subscription yet. So, is there any way we could install wine.
 
Old 09-09-2013, 07:46 AM   #10
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,456

Rep: Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844
Quote:
Originally Posted by coolpul View Post
Hi pan64,
I had converted CSV to XML using a c++ program and in windows this xml is used to convert to c++ header file using msxsl.exe but this does not work in Linux.
It looks like mxsxsl.exe is an XSLT processor, you can probably use the same xsl file with xsltproc.
 
1 members found this post helpful.
Old 09-09-2013, 07:50 AM   #11
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
I had searched earlier for xsltproc and found that it adds XSLT stylesheet to xml document whereas I need to convert xml to c++ header file.
 
Old 09-09-2013, 08:25 AM   #12
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,378

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
Let me say this as politely as I can ... and please understand that I do not mean to insult you in any way.

The tool you have (an XSLT processor) is the tool that you want to use ... but you don't know it yet. You don't know how to use it yet. Therefore, start by learning. Rome wasn't built in a day. At this point, you are quite ignorant of the subject, and it plainly shows. So, that becomes the first obstacle to be addressed in getting this particular problem solved: learn how.

Surf for "XSLT." Gawk at the Periodic Table of the Elements that was created entirely using XSLT, then browse its source-code on your browser. (Your browser does the work!)
 
Old 09-09-2013, 08:29 AM   #13
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Sundialsvcs,
Thanks for the suggestion and appreciate for helping me to move forward step by step but as am stuck in middle of some official work and thus am in process to find out on converting xml to c++ header file directly.
I will definitely start learning by the way you have mentioned but after this work is completed.
 
Old 09-09-2013, 08:34 AM   #14
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,023

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by sundialsvcs View Post
...Surf for "XSLT." Gawk at the Periodic Table of the Elements that was created entirely using XSLT, then browse its source-code on your browser. (Your browser does the work!)
i originally interpreted that as gnu-awk <@.

it mite be possible to use awk as some sort of xml parser ?

Last edited by schneidz; 09-09-2013 at 08:50 AM.
 
Old 09-09-2013, 09:17 AM   #15
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,287

Rep: Reputation: 173Reputation: 173
Why don't you try doing it in windows and copy it across?

Whatever you are trying to do I doubt it will work.
Mixing windows and linux based source isn't a fruitful exercise, generally.

Then you haven't explained much detail.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add xml-stylesheet tag in a XML File using libxml2 ? peacemission Programming 6 05-26-2012 02:20 AM
How to check missing header files included from another header file adisan82 Linux - Software 1 01-28-2011 03:57 AM
java works but only part with php to transform xml richard22 Programming 4 03-20-2005 10:42 PM
What packages are needed to generate lib-javox-xml-transform-2.4.1.so, etc. satimis Fedora 0 09-25-2004 09:51 AM
How can I transform XML into HTML on bash? pedrosan Linux - Newbie 0 04-22-2004 02:37 AM


All times are GMT -5. The time now is 05:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration