drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/HrefSet.java
public void insertHrefBefore(String newHref, String refHref) {
        String refHrefEncoded = encodeHref(refHref);
        String newHrefEncoded = encodeHref(newHref);
        if (isDuplicate(newHrefEncoded))
            return;
        Element child = getFirstChild(root, "href"); //$NON-NLS-1$
        while (child != null) {
            if (refHrefEncoded.equals(getFirstText(child))) {
                insertBefore(child, "href", newHrefEncoded); //$NON-NLS-1$
                return;
            }
            child = getNextSibling(child, "href"); //$NON-NLS-1$
        }
        Assert.isTrue(false, Policy.bind("assert.noHrefRef")); //$NON-NLS-1$
    }
public void insertHrefBefore(String newHref, String refHref) {
        String refHrefEncoded = encodeHref(refHref);
        String newHrefEncoded = encodeHref(newHref);
        if (isDuplicate(newHrefEncoded))
            return;
        Element child = getFirstChild(root, "href"); //$NON-NLS-1$
        while (child != null) {
            if (refHrefEncoded.equals(getFirstText(child))) {
                insertBefore(child, "href", newHrefEncoded); //$NON-NLS-1$
                return;
            }
            child = getNextSibling(child, "href"); //$NON-NLS-1$
        }
        Assert.isTrue(false, Policy.bind("assert.noHrefRef")); //$NON-NLS-1$
    }
Inserts the given newHref before the given refHref in the set of
hrefs. If newHref already exists it is not inserted.

@param refHref the existing href
@param newHref the new href to be inserted before the existing href