private XmlWriter AddConformanceWrapper(XmlWriter baseWriter)
        {
            System.Xml.ConformanceLevel auto     = System.Xml.ConformanceLevel.Auto;
            XmlWriterSettings           settings = baseWriter.Settings;
            bool checkValues     = false;
            bool checkNames      = false;
            bool replaceNewLines = false;
            bool flag4           = false;

            if (settings == null)
            {
                if (this.newLineHandling == System.Xml.NewLineHandling.Replace)
                {
                    replaceNewLines = true;
                    flag4           = true;
                }
                if (this.checkCharacters)
                {
                    checkValues = true;
                    flag4       = true;
                }
            }
            else
            {
                if (this.conformanceLevel != settings.ConformanceLevel)
                {
                    auto  = this.ConformanceLevel;
                    flag4 = true;
                }
                if (this.checkCharacters && !settings.CheckCharacters)
                {
                    checkValues = true;
                    checkNames  = auto == System.Xml.ConformanceLevel.Auto;
                    flag4       = true;
                }
                if ((this.newLineHandling == System.Xml.NewLineHandling.Replace) && (settings.NewLineHandling == System.Xml.NewLineHandling.None))
                {
                    replaceNewLines = true;
                    flag4           = true;
                }
            }
            XmlWriter writer = baseWriter;

            if (flag4)
            {
                if (auto != System.Xml.ConformanceLevel.Auto)
                {
                    writer = new XmlWellFormedWriter(writer, this);
                }
                if (checkValues || replaceNewLines)
                {
                    writer = new XmlCharCheckingWriter(writer, checkValues, checkNames, replaceNewLines, this.NewLineChars);
                }
            }
            if (!this.IsQuerySpecific || ((settings != null) && settings.IsQuerySpecific))
            {
                return(writer);
            }
            return(new QueryOutputWriterV1(writer, this));
        }
Ejemplo n.º 2
0
 private void Initialize()
 {
     this.nameTable                 = null;
     this.xmlResolver               = this.CreateDefaultResolver();
     this.lineNumberOffset          = 0;
     this.linePositionOffset        = 0;
     this.checkCharacters           = true;
     this.conformanceLevel          = System.Xml.ConformanceLevel.Document;
     this.ignoreWhitespace          = false;
     this.ignorePIs                 = false;
     this.ignoreComments            = false;
     this.dtdProcessing             = System.Xml.DtdProcessing.Prohibit;
     this.closeInput                = false;
     this.maxCharactersFromEntities = 0L;
     this.maxCharactersInDocument   = 0L;
     this.schemas          = null;
     this.validationType   = System.Xml.ValidationType.None;
     this.validationFlags  = XmlSchemaValidationFlags.ProcessIdentityConstraints;
     this.validationFlags |= XmlSchemaValidationFlags.AllowXmlAttributes;
     this.isReadOnly       = false;
 }
 private void Initialize()
 {
     this.encoding            = System.Text.Encoding.UTF8;
     this.omitXmlDecl         = false;
     this.newLineHandling     = System.Xml.NewLineHandling.Replace;
     this.newLineChars        = Environment.NewLine;
     this.indent              = TriState.Unknown;
     this.indentChars         = "  ";
     this.newLineOnAttributes = false;
     this.closeOutput         = false;
     this.namespaceHandling   = System.Xml.NamespaceHandling.Default;
     this.conformanceLevel    = System.Xml.ConformanceLevel.Document;
     this.checkCharacters     = true;
     this.outputMethod        = XmlOutputMethod.Xml;
     this.cdataSections.Clear();
     this.mergeCDataSections = false;
     this.mediaType          = null;
     this.docTypeSystem      = null;
     this.docTypePublic      = null;
     this.standalone         = XmlStandalone.Omit;
     this.isReadOnly         = false;
 }
 private void Initialize()
 {
     this.nameTable = null;
     this.xmlResolver = this.CreateDefaultResolver();
     this.lineNumberOffset = 0;
     this.linePositionOffset = 0;
     this.checkCharacters = true;
     this.conformanceLevel = System.Xml.ConformanceLevel.Document;
     this.ignoreWhitespace = false;
     this.ignorePIs = false;
     this.ignoreComments = false;
     this.dtdProcessing = System.Xml.DtdProcessing.Prohibit;
     this.closeInput = false;
     this.maxCharactersFromEntities = 0L;
     this.maxCharactersInDocument = 0L;
     this.schemas = null;
     this.validationType = System.Xml.ValidationType.None;
     this.validationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints;
     this.validationFlags |= XmlSchemaValidationFlags.AllowXmlAttributes;
     this.isReadOnly = false;
 }