コード例 #1
0
        public JsonProcessor(TextReader jsonInput, JsonToXmlStreamSettings settings)
        {
            Settings  = settings;
            JsonInput = jsonInput;

            if (String.IsNullOrEmpty(Settings.Prefix) == false && String.IsNullOrEmpty(Settings.Namespace))
            {
                Settings.Namespace = "http://jsontoxml/";
            }


            wtr = XmlWriter.Create(m_stm, new XmlWriterSettings
            {
                Encoding           = Settings.Encoding,
                Indent             = Settings.Indent,
                OmitXmlDeclaration = Settings.OmitXmlDeclaration
            });

            reader = new JsonTextReader(JsonInput);

            //This does not work on a readonly stream like a network stream
            //Match match = Regex.Match(json, @"^{[ \x00-\x1F\x7F]*'[a-z]*'[ \x00-\x1F\x7F]*:[ \x00-\x1F\x7F]*{", RegexOptions.IgnoreCase);
        }
 public JsonToXmlStream(TextReader reader, JsonToXmlStreamSettings settings)
 {
     this.jsonInput = reader;
     this.settings  = settings;
     LoadExcludes();
 }
 public SchemalessProcessor(TextReader jsonInput, JsonToXmlStreamSettings settings) : base(jsonInput, settings)
 {
 }
 public JsonToXmlStream(TextReader reader)
 {
     this.jsonInput = reader;
     this.settings  = new JsonToXmlStreamSettings();
     LoadExcludes();
 }