예제 #1
0
        private void WriteCollationRulesFromICUString(XmlWriter writer, XmlReader reader, string icu)
        {
            Debug.Assert(writer != null);
            icu = icu ?? string.Empty;
            if (reader != null)
            {
                // don't copy any alias that would override our rules
                if (FindElement(reader, "alias"))
                {
                    reader.Skip();
                }
                CopyUntilElement(writer, reader, "settings");
                // for now we'll omit anything in the suppress_contractions and optimize nodes
                FindElement(reader, "special");
            }
            IcuRulesParser parser = new IcuRulesParser(false);
            string         message;

            // avoid throwing exception, just don't save invalid data
            if (!parser.ValidateIcuRules(icu, out message))
            {
                return;
            }
            parser.WriteIcuRules(writer, icu);
        }
예제 #2
0
        public void EmptyString_ProducesNoRules()
        {
            _icuParser.WriteIcuRules(_writer, string.Empty);
            string result = Environment_OutputString();

            Assert.AreEqual("", result);
        }
예제 #3
0
		private void WriteCollationRulesFromICUString(XmlWriter writer, string icu)
		{
			icu = icu ?? string.Empty;

			IcuRulesParser parser = new IcuRulesParser(false);
			string message;
			// avoid throwing exception, just don't save invalid data
			if (!parser.ValidateIcuRules(icu, out message))
			{
				return;
			}
			parser.WriteIcuRules(writer, icu);
		}
예제 #4
0
		private void WriteCollationRulesFromICUString(XmlWriter writer, XmlReader reader, string icu)
		{
			Debug.Assert(writer != null);
			icu = icu ?? string.Empty;
			if (reader != null)
			{
				// don't copy any alias that would override our rules
				if (FindElement(reader, "alias"))
				{
					reader.Skip();
				}
				CopyUntilElement(writer, reader, "settings");
				// for now we'll omit anything in the suppress_contractions and optimize nodes
				FindElement(reader, "special");
			}
			IcuRulesParser parser = new IcuRulesParser(false);
			string message;
			// avoid throwing exception, just don't save invalid data
			if (!parser.ValidateIcuRules(icu, out message))
			{
				return;
			}
			parser.WriteIcuRules(writer, icu);
		}