Java Code Examples for org.jdom2.Element#sortChildren()

The following examples show how to use org.jdom2.Element#sortChildren() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void sort(Document document) {
    Comparator<Element> comparator = new DMNNodeComparator();

    // Sort definitions
    Element rootElement = document.getRootElement();
    if (rootElement != null) {

        // Sort decision
        Element decision = rootElement.getChild("decision", Namespace.getNamespace("dmn", DMN_11.getNamespace()));
        if (decision != null) {
Example 2
private static void sortAttributes(Document userXML) {
    Element attributes = userXML.getRootElement().getChild("attributes");
    if (attributes == null) {
    attributes.sortChildren(Comparator.comparing(o -> o.getAttributeValue("name")));
Example 3
public Element createXML() throws MCRException {
    final Element xml = super.createXML();;


    return xml;
Example 4
public static void sort(Element mods) {