LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 05:34 PM   #16
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083

Quote:
Originally Posted by coolpul View Post
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.
Quote:
Originally Posted by coolpul View Post
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.
If you already have a working xsl file with msxsl.exe, it will be fastest and easiest to use this with xsltproc. An example:
Code:
<?xml version="1.0"?>
<!-- gen-c.xsl -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output omit-xml-declaration="yes" indent="no" method="text"/>
  <xsl:template match="/Root/Row">
    <xsl:value-of select="concat(Type, ' ', Function, ';')"/>
  </xsl:template>
</xsl:stylesheet>
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- header.xml -->
<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</path-of-file></File>
    <Function>DifferenceReportDlg::OnOK() </Function>
    <Source_Line_Number>288</Source_Line_Number>
  </Row>
</Root>
Code:
% xsltproc gen-c.xsl header.xml

  E DifferenceReportDlg::OnOK() ;
Look C code! Magic right? The thing is you ALREADY HAVE A COMPLETE VERSION of gen-c.xsl since you must be using this with msxsl.exe. Now just use it with xstlproc.
 
Old 09-09-2013, 11:22 PM   #17
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
xsltproc resolved my problem. I was not passing the xsl file and thus was getting error.

Thanks everyone for the help
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:32 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration