• R/O
  • HTTP
  • SSH
  • HTTPS

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

OmegaChartのソースコードの保守


File Info

修訂. abec95183e38adccdd3ae834f0e303862ebeff62
大小 890 bytes
時間 2022-12-15 22:48:19
作者 panacoran
Log Message

Yahooファイナンスからの株価取得が途中で止まるのを回避

Content

/*
 * Copyright (c) Daisuke OKAJIMA    All rights reserved.
 * 
 * $Id$
 */
using System;
using System.Xml;

using Travis.Util;

namespace Travis.Storage
{
	public class DOMNodeReader : NodeReader {
		private XmlDocument _doc;
		public DOMNodeReader(XmlDocument doc) {
			_doc = doc;
		}
		public override StorageNode Read() {
			return ReadNode(_doc.DocumentElement);
		}
		private StorageNode ReadNode(XmlElement elem) {
			StorageNode node = new StorageNode();
			node.Name = elem.LocalName;
			foreach(XmlAttribute attr in elem.Attributes)
				node[attr.LocalName] = attr.Value;
			foreach(XmlNode ch in elem.ChildNodes) {
				if(ch is XmlElement)
					node.AddChild(ReadNode((XmlElement)ch));
				else if(ch is XmlText || ch is XmlCDataSection)
					node.TextValue = ch.Value;
			}
			return node;

		}
		public override void Close() {
		}

	}
}