@Test public void testParseOldXML() throws ParserConfigurationException, SAXException, IOException { final Document xml = XMLTools.parseDOM(OLD_XML); final PrairieMetadata meta = new PrairieMetadata(xml, null, null); final Value positionCurrent = meta.getSequence(1).getFrame(1).getValue("positionCurrent"); final Value xAxis = positionCurrent.get("XAxis"); assertEquals("0.95", xAxis.value()); final Value yAxis = positionCurrent.get("YAxis"); assertEquals("-4.45", yAxis.value()); final ValueTable zAxis = (ValueTable) positionCurrent.get("ZAxis"); assertEquals("-9", zAxis.get(0).value()); assertEquals("62.45", zAxis.get(1).value()); }
/** * Returns {@code value.get(index).value()}, or null if {@code value} or * {@code value.get(index)} is null. */ private String value(final Value value, final int index) { if (value == null) return null; final Value v = value.get(index); return v == null ? null : v.value(); }
/** * Returns {@code value.get(key).value()}, or null if {@code value} or * {@code value.get(key)} is null. */ private String value(final Value value, final String key) { if (value == null) return null; final Value v = value.get(key); return v == null ? null : v.value(); }
/** * Returns {@code value.get(index).value()}, or null if {@code value} or * {@code value.get(index)} is null. */ private String value(final Value value, final int index) { if (value == null) return null; final Value v = value.get(index); return v == null ? null : v.value(); }
/** * Returns {@code value.get(key).value()}, or null if {@code value} or * {@code value.get(key)} is null. */ private String value(final Value value, final String key) { if (value == null) return null; final Value v = value.get(key); return v == null ? null : v.value(); }