This removes the first child element (one level deep) with the given local name and belonging to no namespace. Returns true if a child was removed.
606607608609610611612613614615616
undoRedoManager.demarcateUOW(); elem03.getContent().remove(0); //text03 elem03.removeChild("elem031"); elem03.getContent().remove(0); //more_text03 elem03.removeChild("elem033"); elem03.getContent().remove(0); //more_more_text03 assertTrue(elem03.getContent().isEmpty()); assertTrue(elem03.getAttributes().isEmpty());
235236237238239240241242243244245
String id = ""+metadata.getId(); boolean forEditing = false; boolean withEditorValidationErrors = false; Element data = dm.getMetadata(context, id, forEditing, withEditorValidationErrors, !removeXlinkAttribute); data.removeChild("info", Edit.NAMESPACE); metadata.setData(Xml.getString(data)); return metadata; }
130131132133134135136137138139140
} else { // collect up all the schemas that we can convert to create prefix, // search ids and add to the result set List<String> schemas = getSchemasThatCanConvertTo(prefix); for (String schema : schemas) { params.removeChild("_schema"); params.addContent(new Element("_schema").setText(schema)); result.addIds(Lib.search(context, (Element)params.clone())); } if (schemas.size() == 0) result.setIds(new ArrayList<Integer>()); }
172173174175176177178179180
} @Override protected Element asXml(IdentityHashMap<Object, Void> alreadyEncoded) { final Element element = super.asXml(alreadyEncoded); element.removeChild("password"); return element; } }
3940414243444546474849
public void testCopy() throws Exception { final SchematronCriteria criteria = SchematronCriteriaGroupRepositoryTest.newSchematronCriteria(_inc); final SchematronCriteria copy = criteria.copy(); Element expectedXml = criteria.asXml(); expectedXml.removeChild("id"); Element actualXml = copy.asXml(); actualXml.removeChild("id"); assertEquals(Xml.getString(expectedXml), Xml.getString(actualXml));
42434445464748495051
Element expectedXml = criteria.asXml(); expectedXml.removeChild("id"); Element actualXml = copy.asXml(); actualXml.removeChild("id"); assertEquals(Xml.getString(expectedXml), Xml.getString(actualXml)); } }
16411642164316441645164616471648164916501651
* @return * @throws Exception */ public Element getMetadataNoInfo(ServiceContext srvContext, String id) throws Exception { Element md = getMetadata(srvContext, id, false, false, false); md.removeChild(Edit.RootChild.INFO, Edit.NAMESPACE); return md; } /** * Retrieves a metadata (in xml) given its id. Use this method when you must retrieve a metadata in the same
361362363364365366367368369370371
if (!dataMan.getAccessManager().canEdit(context, id)) throw new NoApplicableCodeEx("User not allowed to update this metadata(" + id + ")."); Element metadata = dataMan.getMetadata(context, id, false, false, true); metadata.removeChild("info", Edit.NAMESPACE); // Retrieve the schema and Namespaces of metadata to update String schemaId = gc.getBean(DataManager.class).autodetectSchema(metadata); if (schemaId == null) {