Why is XMLParser not parsing camel case attributes?

31 views
Skip to first unread message

guma...@gmail.com

unread,
Oct 14, 2013, 9:00:37 PM10/14/13
to gwt-test-u...@googlegroups.com
Hi everyone,

I'm trying to parse my xml string that contains some camel case attributes and for some reason it just doesn't work.

Below is a simple test to help:

@Test
public void xmlAttributeParsingProblem() {
    Document oDoc = XMLParser.parse("<toto><tata myAttribute=\"titi\" myAttribute2=\"tete\" test=\"test1\" testMe=\"hello\" test_me=\"world\"><tutu/></tata></toto>");
    Node oToto = oDoc.getChildNodes().item(0);
    Node oTata = oToto.getFirstChild();

    assertEquals("test1", oTata.getAttributes().getNamedItem("test").getNodeValue()); //WORKS
    assertEquals("world", oTata.getAttributes().getNamedItem("test_me").getNodeValue()); //WORKS!
    assertEquals("hello", oTata.getAttributes().getNamedItem("testMe").getNodeValue()); // DOES NOT WORK
    assertEquals("tete", oTata.getAttributes().getNamedItem("myAttribute2").getNodeValue()); // DOES NOT WORK
    assertEquals("titi", oTata.getAttributes().getNamedItem("myAttribute").getNodeValue()); // DOES NOT WORK
}

Any ideas why is that happening? is that a GWT thing or what gwt-test-utils use for parsing?

Thanks!
Reply all
Reply to author
Forward
0 new messages