/** * This method will compare the original document with the proposed document * and return true if adjustments to the original document were necessary. * Adjustments are only made if new elements or attributes are proposed. * Changes to the order of attributes or elements in the original document * will not result in an adjustment. * * @param original document as read from the file system * @param proposed document as determined by the JspViewManager * @return true if the document was adjusted, otherwise false */ public static boolean compareDocuments(final Document original, final Document proposed) { boolean originalDocumentAdjusted = checkNamespaces(original, proposed); originalDocumentAdjusted |= addOrUpdateElements(original.getDocumentElement(), proposed.getDocumentElement(), originalDocumentAdjusted); originalDocumentAdjusted |= removeElements(original.getDocumentElement(), proposed.getDocumentElement(), originalDocumentAdjusted); return originalDocumentAdjusted; }