Quote:
Originally Posted by coolpul
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
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.