OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_4.java
protected void upgradeAnhangElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:anhang/io:daten/io:pfad | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:anhaenge/io:anhang/io:daten/io:pfad",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parentNode = (Element) node.getParentNode().getParentNode();
            String value = StringUtils.trimToEmpty(node.getTextContent()).toLowerCase();
            if (value.startsWith("http://"))
                parentNode.setAttribute("location", "REMOTE");
            else if (value.startsWith("https://"))
                parentNode.setAttribute("location", "REMOTE");
            else if (value.startsWith("ftp://"))
                parentNode.setAttribute("location", "REMOTE");
            else if (value.startsWith("ftps://"))
                parentNode.setAttribute("location", "REMOTE");
        }
    }
protected void upgradeAnhangElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:anhang/io:daten/io:pfad | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:anhaenge/io:anhang/io:daten/io:pfad",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parentNode = (Element) node.getParentNode().getParentNode();
            String value = StringUtils.trimToEmpty(node.getTextContent()).toLowerCase();
            if (value.startsWith("http://"))
                parentNode.setAttribute("location", "REMOTE");
            else if (value.startsWith("https://"))
                parentNode.setAttribute("location", "REMOTE");
            else if (value.startsWith("ftp://"))
                parentNode.setAttribute("location", "REMOTE");
            else if (value.startsWith("ftps://"))
                parentNode.setAttribute("location", "REMOTE");
        }
    }
protected void upgradeAnhangElements ( Document doc ) throws JaxenException { List nodes = XmlUtils . newXPath ( "/io:openimmo/io:anbieter/io:anhang/io:daten/io:pfad | " + "/io:openimmo/io:anbieter/io:immobilie/io:anhaenge/io:anhang/io:daten/io:pfad" , doc ) . selectNodes ( doc ) ; for ( Object item : nodes ) { Element node = ( Element ) item ; Element parentNode = ( Element ) node . getParentNode ( ) . getParentNode ( ) ; String value = StringUtils . trimToEmpty ( node . getTextContent ( ) ) . toLowerCase ( ) ; if ( value . startsWith ( "http://" ) ) parentNode . setAttribute ( "location" , "REMOTE" ) ; else if ( value . startsWith ( "https://" ) ) parentNode . setAttribute ( "location" , "REMOTE" ) ; else if ( value . startsWith ( "ftp://" ) ) parentNode . setAttribute ( "location" , "REMOTE" ) ; else if ( value . startsWith ( "ftps://" ) ) parentNode . setAttribute ( "location" , "REMOTE" ) ; } }
Upgrade &lt;anhang&gt; elements to OpenImmo 1.2.4.
<p>
The option "REMOTE" for the "location" attribute of &lt;anhang&gt; elements
is introduced with OpenImmo 1.2.4.
<p>
If the &lt;pfad&gt; element of an &lt;anhang&gt; element contains an URL
(beginning with "http://" / "https://" / "ftp://" / "ftps://"), the value
of the "location" attribute is changed to "REMOTE".

@param doc OpenImmo document in version 1.2.3
@throws JaxenException if xpath evaluation failed
Upgrade &lt ; anhang&gt ; elements to OpenImmo 1 . 2 . 4 . <p > The option REMOTE for the location attribute of &lt ; anhang&gt ; elements is introduced with OpenImmo 1 . 2 . 4 . <p > If the &lt ; pfad&gt ; element of an &lt ; anhang&gt ; element contains an URL ( beginning with http : // / https : // / ftp : // / ftps : // ) the value of the location attribute is changed to REMOTE .