OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_2.java
protected void downgradeObjektartElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element parentNode = (Element) item;
            String type = null;

            List childNodes = XmlUtils.newXPath(
                    "*", doc).selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Element node = (Element) childItem;
                if (type == null) {
                    //LOGGER.debug( "PRIMARY TYPE: " + node.getLocalName() );
                    type = node.getLocalName();
                } else if (!type.equalsIgnoreCase(node.getLocalName())) {
                    //LOGGER.debug( "REMOVE SECONDARY TYPE: " + node.getLocalName() );
                    parentNode.removeChild(node);
                }
            }
        }
    }
protected void downgradeObjektartElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element parentNode = (Element) item;
            String type = null;

            List childNodes = XmlUtils.newXPath(
                    "*", doc).selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Element node = (Element) childItem;
                if (type == null) {
                    //LOGGER.debug( "PRIMARY TYPE: " + node.getLocalName() );
                    type = node.getLocalName();
                } else if (!type.equalsIgnoreCase(node.getLocalName())) {
                    //LOGGER.debug( "REMOVE SECONDARY TYPE: " + node.getLocalName() );
                    parentNode.removeChild(node);
                }
            }
        }
    }
protected void downgradeObjektartElements ( Document doc ) throws JaxenException { List nodes = XmlUtils . newXPath ( "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart" , doc ) . selectNodes ( doc ) ; for ( Object item : nodes ) { Element parentNode = ( Element ) item ; String type = null ; List childNodes = XmlUtils . newXPath ( "*" , doc ) . selectNodes ( parentNode ) ; for ( Object childItem : childNodes ) { Element node = ( Element ) childItem ; if ( type == null ) { //LOGGER.debug( "PRIMARY TYPE: " + node.getLocalName() ); type = node . getLocalName ( ) ; } else if ( ! type . equalsIgnoreCase ( node . getLocalName ( ) ) ) { //LOGGER.debug( "REMOVE SECONDARY TYPE: " + node.getLocalName() ); parentNode . removeChild ( node ) ; } } } }
Downgrade &lt;objektart&gt; elements to OpenImmo 1.2.1.
<p>
The &lt;objektart&gt; element does only allow the same type of child
element in version 1.2.1.
<p>
Any child type, that differs from the first child type, is removed.

@param doc OpenImmo document in version 1.2.2
@throws JaxenException if xpath evaluation failed
Downgrade &lt ; objektart&gt ; elements to OpenImmo 1 . 2 . 1 . <p > The &lt ; objektart&gt ; element does only allow the same type of child element in version 1 . 2 . 1 . <p > Any child type that differs from the first child type is removed .