Xml declaration
HejJeg vil gerne sætte encoding på min xml doc og det har jeg læst at det foregår sådan her:
XmlDocument doc = new XmlDocument();
XmlDeclaration xmlDecl = doc.CreateXmlDeclaration("1.0", "iso-8859-1", null);
XmlNode HeadNode = doc.CreateNode(XmlNodeType.Element, "Invoice", null);
doc.InsertBefore(xmlDecl, doc.DocumentElement);
HeadNode = doc.CreateNode(XmlNodeType.Element, "Invoice", "http://rep.oio.dk/ubl/xml/schemas/0p71/pip/");
doc.AppendChild(HeadNode);
Men jeg får bare dette ud :
<?xml version="1.0" encoding="ibm850"?>
<Invoice xmlns="http://rep.oio.dk/ubl/xml/schemas/0p71/pip/" />
Hvad gør jeg forkert ?
