@Test
    public void testIllegalAttributeNames() {
        String illegalNames[] = {">foo", "foo<bar", " foo", "bar ", "foo bar", "foo\"bar", "&foo"};
        XmlStream xml = new XmlStream();
        for (String name : illegalNames) {
            try {
                xml.beginTag(name);
                assertTrue(false);
            } catch (IllegalArgumentException e) {
                assertTrue(e.getMessage().indexOf("cannot be used as an XML tag name") != -1);
            }
        }
        xml.beginTag("test");
        for (String name : illegalNames) {
            try {
                xml.addAttribute(name, "");
                assertTrue(false);
            } catch (IllegalArgumentException e) {
                assertTrue(e.getMessage().indexOf("cannot be used as an XML attribute name") != -1);
            }
        }
    }
Test that XML tag and attribute names are checked for validity.
Only the obvious illegal characters are tested currently.
document/src/test/java/com/yahoo/document/serialization/XmlStreamTestCase.java