Your stylesheet must have these lines at the beginning:
<xsl:stylesheet xmlns:xsl=" <http://www.w3.org/1999/XSL/Transform>
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nombre de Jason
Enviado el: jueves, 08 de marzo de 2007 8:52
Para: [email protected]
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
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml