SchemaElement { public static SchemaReference readElement(final OMElement siElement) { if (siElement == null) return null; final SchemaReference schemaData = new SchemaReference(); schemaData.setLocation(siElement.getAttributeValue(new QName(LN_ATTR_LOCATION))); schemaData.setNamespace(siElement.getAttributeValue(new QName(LN_ATTR_NAMESPACE))); schemaData.setVersion(siElement.getAttributeValue(new QName(LN_ATTR_VERSION))); return schemaData; }  static OMElement createElement(final OMElement piElement, final ISchemaReference data); static OMElement getElement(final OMElement piElement); static SchemaReference readElement(final OMElement siElement); static final QName Q_ELEMENT_NAME; static final String LN_ATTR_LOCATION; static final String LN_ATTR_VERSION; static final String LN_ATTR_NAMESPACE; }
@Test public void testReadElement() throws Exception { String location = "http: String ns = "http: String version = "2.0"; SchemaReference schema = SchemaElement.readElement(createXML( "<eb3:Schema xmlns:eb3=\"http: + " location=\"" + location + "\"" + " namespace=\"" + ns + "\"" + " version=\"" + version + "\"" + "/>")); assertNotNull(schema); assertEquals(location, schema.getLocation()); assertEquals(ns, schema.getNamespace()); assertEquals(version, schema.getVersion()); }