private void AddNamespaceMapping(XmlNamespaceContext namespaceContext, XmlWriterImpl xmlWriter, string prefix, string uri) { if (namespaceContext.LookupPrefix(uri) == ValueFactory.Create()) { xmlWriter.WriteNamespaceMapping(prefix, uri); } }
private void WriteXMLUndefined(XmlWriterImpl xmlWriter, string name, XMLForm form) { if (form == XMLForm.Element) { XmlNamespaceContext namespaceContext = xmlWriter.NamespaceContext; AddNamespaceMapping(namespaceContext, xmlWriter, "", XmlSchema.Namespace); AddNamespaceMapping(namespaceContext, xmlWriter, "xsi", XmlSchema.InstanceNamespace); xmlWriter.WriteStartElement(name); xmlWriter.WriteStartAttribute("nil", XmlSchema.InstanceNamespace); xmlWriter.WriteText("true"); xmlWriter.WriteEndAttribute(); xmlWriter.WriteEndElement(); } }