コード例 #1
0
        /// <summary>
        /// Initializes this target.
        /// </summary>
        public override void Initialize()
        {
            _serNode     = new XmlSerializer(typeof(Osm.Xml.v0_6.node));
            _serWay      = new XmlSerializer(typeof(Osm.Xml.v0_6.way));
            _serRelation = new XmlSerializer(typeof(Osm.Xml.v0_6.relation));

            var settings = new XmlWriterSettings();

            settings.OmitXmlDeclaration = true;
            settings.ConformanceLevel   = ConformanceLevel.Fragment;
            settings.Encoding           = Encoding.ASCII;

            if (_textWriter == null)
            {
                _textWriter = File.CreateText(_fileName);
            }

            _textWriter.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            _textWriter.WriteLine("<osm version=\"0.6\" generator=\"OsmSharp\">");

            _writer = new XmlFragmentWriter(_textWriter);
        }
コード例 #2
0
        /// <summary>
        /// Initializes this target.
        /// </summary>
        public override void Initialize()
        {
            _serNode = new XmlSerializer(typeof(Osm.Xml.v0_6.node));
            _serWay = new XmlSerializer(typeof(Osm.Xml.v0_6.way));
            _serRelation = new XmlSerializer(typeof(Osm.Xml.v0_6.relation));

            var settings = new XmlWriterSettings();
            settings.OmitXmlDeclaration = true;
            settings.ConformanceLevel = ConformanceLevel.Fragment;
            settings.Encoding = Encoding.ASCII;

            if (_textWriter == null)
            {
                _textWriter = File.CreateText(_fileName);
            }

            _textWriter.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            _textWriter.WriteLine("<osm version=\"0.6\" generator=\"OsmSharp\">");

            _writer = new XmlFragmentWriter(_textWriter);
        }