Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison api/Factories/Xml/WarFoundryXmlSaver.cs @ 125:c60fd5664698
Re #53: Create WarFoundry save class to store army as file
* Fix exceptions thrown by official .Net XML parsing of namespace names
Also:
* Remove unnecessary notification of name change
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 24 Aug 2009 21:12:18 +0000 |
parents | 571eee2b7b30 |
children | f58051572ec7 |
comparison
equal
deleted
inserted
replaced
124:d59aa4e46761 | 125:c60fd5664698 |
---|---|
66 { | 66 { |
67 XmlDocument doc = new XmlDocument(); | 67 XmlDocument doc = new XmlDocument(); |
68 XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", null, null); | 68 XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", null, null); |
69 doc.AppendChild(declaration); | 69 doc.AppendChild(declaration); |
70 XmlSchema schema = new XmlSchema(); | 70 XmlSchema schema = new XmlSchema(); |
71 schema.Namespaces.Add("xmlns", "http://ibboard.co.uk/warfoundry/army"); | 71 schema.Namespaces.Add("", "http://ibboard.co.uk/warfoundry/army"); |
72 schema.Namespaces.Add("xmlns:core", "http://ibboard.co.uk/warfoundry/core"); | 72 schema.Namespaces.Add("core", "http://ibboard.co.uk/warfoundry/core"); |
73 doc.Schemas.Add(schema); | 73 doc.Schemas.Add(schema); |
74 XmlElement root = doc.CreateElement("army"); | 74 XmlElement root = doc.CreateElement("army"); |
75 root.SetAttribute("xmlns", "http://ibboard.co.uk/warfoundry/army"); | 75 root.SetAttribute("xmlns", "http://ibboard.co.uk/warfoundry/army"); |
76 root.SetAttribute("xmlns:core", "http://ibboard.co.uk/warfoundry/core"); | 76 root.SetAttribute("xmlns:core", "http://ibboard.co.uk/warfoundry/core"); |
77 doc.AppendChild(root); | 77 doc.AppendChild(root); |