Hi Loren, Loren Bandiera schrieb: > I want to write an XML document but there are some parts I'm not sure > how to go about doing. Specifically namespaces and schemas. Take the > following example XML: > > <?xml version="1.0" encoding="UTF-8"?> > <doc xmlns="http://whatever.org/XMLSchema/foo" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://whatever.org/XMLSchema/foo.xsd"> > <foo>bar</foo> > </doc> > > To create it, I've tried doing something like this: > > XmlDocument xmlDoc = new XmlDocument (); > xmlDoc.AppendChild (xmlDoc.CreateNode > (XmlNodeType.XmlDeclaration,"","")); > > XmlElement docElement = xmlDoc.CreateElement ("doc"); > docElement.SetAttribute ("xmlns", "http://whatever.org/XMLSchema/foo"); > I believe CreateElement is actually overloaded so that you can give the namespace directly as an argument without setting it manually afterwards. :-)
HTH, Andreas _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
