Re: [xml] How to skip "<?xml version="1.0"?>" in the output?



Your stylesheet must have these lines at the beginning:
 
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="text">
 
XSLT generates XML files by default, so if you want a plain text file you have to declarate it. 
-----Mensaje original-----
De: xml-bounces gnome org [mailto:xml-bounces gnome org]En nombre de Jason
Enviado el: jueves, 08 de marzo de 2007 8:52
Para: xml gnome org
Asunto: [xml] How to skip "<?xml version="1.0"?>" in the output?

Dears,

How can I skip stringï<?xml version="1.0"?>ïwhen saving xml into file?

-----------

xmlDocPtr res;

int err = 0;

res = xsltApplyStylesheet(template, parameter_doc, NULL);

 xsltSaveResultToFile(stdout, res, template);

 

        if (xmlSaveFormatFile(save_file, res, 0) < 0)

        {

                fprintf(stderr, "I/O error in saving file: %s\n", save_file);

                err = -EIO;

        }

 

I am using xml to describing user parameters, and by the helping of a XSLT file, the user parameters will be turned into a C code. So, I didn't want <?xml version="1.0"?> appear in the file generated by xmlSaveFormatFile.

Thanks!


Jason
2007-03-08


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]