59
60 private void testGetAttributeValueWithNs(String nameSpace, String attrName, Consumer<String> checker) throws Exception {
61 XMLInputFactory xif = XMLInputFactory.newInstance();
62 XMLStreamReader xsr = xif.createXMLStreamReader(new FileInputStream(testFile));
63
64 while (xsr.hasNext()) {
65 xsr.next();
66 if (xsr.isStartElement()) {
67 String v;
68 v = xsr.getAttributeValue(nameSpace, attrName);
69 checker.accept(v);
70 }
71 }
72 }
73
74 private void checkNull(String value)
75 {
76 Assert.assertNotNull(value, "should have attribute value");
77 }
78 }
79
|
59
60 private void testGetAttributeValueWithNs(String nameSpace, String attrName, Consumer<String> checker) throws Exception {
61 XMLInputFactory xif = XMLInputFactory.newInstance();
62 XMLStreamReader xsr = xif.createXMLStreamReader(new FileInputStream(testFile));
63
64 while (xsr.hasNext()) {
65 xsr.next();
66 if (xsr.isStartElement()) {
67 String v;
68 v = xsr.getAttributeValue(nameSpace, attrName);
69 checker.accept(v);
70 }
71 }
72 }
73
74 private void checkNull(String value)
75 {
76 Assert.assertNotNull(value, "should have attribute value");
77 }
78 }
|