internal void AdjustLineInfoOffset(int lineNumberOffset, int linePositionOffset)
 {
     if (entity != null)
     {
         entity.AdjustLineInfoOffset(lineNumberOffset, linePositionOffset);
     }
     source.AdjustLineInfoOffset(lineNumberOffset, linePositionOffset);
 }
Ejemplo n.º 2
0
        private static XmlReader CreateCustomizedTextReader(XmlTextReader reader, XmlReaderSettings settings)
        {
            reader.XmlResolver = settings.XmlResolver;
            // Normalization is set true by default.
            reader.Normalization = true;
#if NOT_PFX
            reader.EntityHandling = EntityHandling.ExpandEntities;
#endif

            if (settings.ProhibitDtd)
            {
                reader.ProhibitDtd = true;
            }

            if (!settings.CheckCharacters)
            {
                reader.CharacterChecking = false;
            }

            // I guess it might be changed in 2.0 RTM to set true
            // as default, or just disappear. It goes against
            // XmlTextReader's default usage and users will have
            // to close input manually (that's annoying). Moreover,
            // MS XmlTextReader consumes text input more than
            // actually read and users can acquire those extra
            // consumption by GetRemainder() that returns different
            // TextReader.
            reader.CloseInput = settings.CloseInput;

            // I would like to support it in detail later;
            // MSDN description looks source of confusion. We don't
            // need examples, but precise list of how it works.
            reader.Conformance = settings.ConformanceLevel;

            reader.AdjustLineInfoOffset(settings.LineNumberOffset,
                                        settings.LinePositionOffset);

            if (settings.NameTable != null)
            {
                reader.SetNameTable(settings.NameTable);
            }

            XmlReader r = CreateFilteredXmlReader(reader, settings);
            r.settings = settings;
            return(r);
        }
Ejemplo n.º 3
0
		private static XmlReader CreateCustomizedTextReader (XmlTextReader reader, XmlReaderSettings settings)
		{
			reader.XmlResolver = settings.XmlResolver;
			// Normalization is set true by default.
			reader.Normalization = true;
			reader.EntityHandling = EntityHandling.ExpandEntities;

			if (settings.ProhibitDtd)
				reader.ProhibitDtd = true;

			if (!settings.CheckCharacters)
				reader.CharacterChecking = false;

			// I guess it might be changed in 2.0 RTM to set true
			// as default, or just disappear. It goes against
			// XmlTextReader's default usage and users will have 
			// to close input manually (that's annoying). Moreover,
			// MS XmlTextReader consumes text input more than 
			// actually read and users can acquire those extra
			// consumption by GetRemainder() that returns different
			// TextReader.
			reader.CloseInput = settings.CloseInput;

			// I would like to support it in detail later;
			// MSDN description looks source of confusion. We don't
			// need examples, but precise list of how it works.
			reader.Conformance = settings.ConformanceLevel;

			reader.AdjustLineInfoOffset (settings.LineNumberOffset,
				settings.LinePositionOffset);

			if (settings.NameTable != null)
				reader.SetNameTable (settings.NameTable);

			XmlReader r = CreateFilteredXmlReader (reader, settings);
			r.settings = settings;
			return r;
		}