On 25/08/2008, Boz <[EMAIL PROTECTED]> wrote: > 2008/8/25 Steven 黄 <[EMAIL PROTECTED]>: > > > I am a xml beginnner, and I am using libxml2 to edit some data for a system > > configuration file which doesn't contain <?xml version="1.0">(all elements > > in this xml are quite standard). Even Though adding this tag to the file > has > > no effect on anything, I still don't like to add it. > > > As per http://xmlsoft.org/html/libxml-xmlsave.html#xmlSaveOption > > You can pass XML_SAVE_NO_DECL to prevent the xml declaration being output
This is what I was going to say too, but also note you should only use unicode encodings (like the default, UTF-8) if you do this, as the encoding declaration goes in the XML prologue as well, and libxml2 will happily omit it if instructed - even in cases where it's required for a well-formed document. There's some example code using XML_SAVE_NO_DECL in the message I sent to the list just before this one. Martin _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
