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); }
public void EmptyString_ProducesNoRules() { _icuParser.WriteIcuRules(_writer, string.Empty); string result = Environment_OutputString(); Assert.AreEqual("", result); }
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); }
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); }