Package org.jdom

Examples of org.jdom.Element.removeChild()


        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());
View Full Code Here


    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;
  }
View Full Code Here

      } 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>());
      }
View Full Code Here

    }

    @Override
    protected Element asXml(IdentityHashMap<Object, Void> alreadyEncoded) {
        final Element element = super.asXml(alreadyEncoded);
        element.removeChild("password");
        return element;
    }
}
View Full Code Here

    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));
View Full Code Here

        Element expectedXml = criteria.asXml();
        expectedXml.removeChild("id");

        Element actualXml = copy.asXml();
        actualXml.removeChild("id");
        assertEquals(Xml.getString(expectedXml), Xml.getString(actualXml));

    }
}
View Full Code Here

     * @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
View Full Code Here

                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) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.