![]() |
| | #1 |
| Registered User Join Date: Mar 2005 Location: Tijuana, BC, México
Posts: 282
| XmlTextWriter Code: //
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Xml;
//
pDoc = new XmlDocument();
XmlProcessingInstruction pPI = pDoc.CreateProcessingInstruction("xml", "version='1.0' encoding='ISO-8859-1'");
pDoc.AppendChild(pPI);
XmlTextWriter writer = new XmlTextWriter("boop.xml", null);
writer.Formatting = Formatting.Indented;
pDoc.Save(writer);
writer.Flush();
__________________ * Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM * Kubuntu 9.10; Kernel 2.6.31-14-generic. * lighttpd: php5, perl, eruby and python. * Codeblocks & geany: HTML & CSS & JavaScript, Gtk+, QT4, wxWidgets, bash, openjdk. * Coming soon: Kubuntu 10.04 or Debian 6.0. |
| Joelito is offline | |
| | #2 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| What error? (The reason is that the XML declaration is not a processing instruction. Read the XML spec.) But when you get an error, you should still post it.
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #3 |
| Registered User Join Date: Mar 2005 Location: Tijuana, BC, México
Posts: 282
| Thanks... i read some tutos and seems that main error is that I don't have a root element. Fixed ![]() I would post the error, but I have the .NET SDK in spanish and the debugger dumps all in spanish.
__________________ * Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM * Kubuntu 9.10; Kernel 2.6.31-14-generic. * lighttpd: php5, perl, eruby and python. * Codeblocks & geany: HTML & CSS & JavaScript, Gtk+, QT4, wxWidgets, bash, openjdk. * Coming soon: Kubuntu 10.04 or Debian 6.0. |
| Joelito is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|