예제 #1
0
 private void AddNamespaceMapping(XmlNamespaceContext namespaceContext, XmlWriterImpl xmlWriter, string prefix, string uri)
 {
     if (namespaceContext.LookupPrefix(uri) == ValueFactory.Create())
     {
         xmlWriter.WriteNamespaceMapping(prefix, uri);
     }
 }
예제 #2
0
        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();
            }
        }