Пример #1
0
        public void add_XixAttribute_to_XElement()
        {
            dynamic xml     = new Xix();
            var     element = new XElement("root", xml.@base("http://google.com"));

            Assert.That(element.ToString(SaveOptions.DisableFormatting), Is.EqualTo("<root base=\"http://google.com\" />"));
        }
Пример #2
0
        public void doesnt_add_on_second_occurence()
        {
            dynamic xml   = new Xix();
            dynamic xlink = new Xix("xlink", "http://www.w3.org/1999/xlink");
            var     doco  = xml.html.attr(xlink.href("http://google.com"))[xml.body.attr(xlink.@base("http://bing.com"))];

            Assert.That(doco.ToString(), Is.EqualTo("<html xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"http://google.com\">" +
                                                    "<body xlink:base=\"http://bing.com\" />" +
                                                    "</html>"));
        }