Example usage for org.w3c.dom Element removeAttribute

List of usage examples for org.w3c.dom Element removeAttribute

Introduction

In this page you can find the example usage for org.w3c.dom Element removeAttribute.

Prototype

public void removeAttribute(String name) throws DOMException;

Source Link

Document

Removes an attribute by name.

Usage

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_3.java

/**
 * Downgrade <bad> elements to OpenImmo 1.2.2.
 * <p>/*from w  ww  .  j  a v a2 s  . c  o m*/
 * The attributes "BIDET", "PISSOIR" for &lt;bad&gt; elements are not
 * available in version 1.2.2.
 * <p>
 * Any occurences of these values are removed.
 *
 * @param doc OpenImmo document in version 1.2.3
 * @throws JaxenException
 */
protected void downgradeBadElements(Document doc) throws JaxenException {
    List nodes = XmlUtils
            .newXPath("/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:bad[@BIDET or @PISSOIR]", doc)
            .selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        node.removeAttribute("BIDET");
        node.removeAttribute("PISSOIR");
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_3.java

/**
 * Downgrade &lt;befeuerung&gt; elements to OpenImmo 1.2.2.
 * <p>/*from   w w w .ja v a  2s .com*/
 * The attribute "PELLET" for &lt;befeuerung&gt; elements is not available in
 * version 1.2.2.
 * <p>
 * Any occurences of these values are removed.
 *
 * @param doc OpenImmo document in version 1.2.3
 * @throws JaxenException
 */
protected void downgradeBefeuerungElements(Document doc) throws JaxenException {
    List nodes = XmlUtils
            .newXPath("/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:befeuerung[@PELLET]", doc)
            .selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        node.removeAttribute("PELLET");
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_3.java

/**
 * Downgrade &lt;boden&gt; elements to OpenImmo 1.2.2.
 * <p>/*w w w.  ja  v a2  s .  co  m*/
 * The attributes "MARMOR", "TERRAKOTTA" for &lt;boden&gt; elements are not
 * available in version 1.2.2.
 * <p>
 * Any occurences of these values are removed.
 *
 * @param doc OpenImmo document in version 1.2.3
 * @throws JaxenException
 */
protected void downgradeBodenElements(Document doc) throws JaxenException {
    List nodes = XmlUtils
            .newXPath("/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:boden[@MARMOR or @TERRAKOTTA]",
                    doc)
            .selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        node.removeAttribute("MARMOR");
        node.removeAttribute("TERRAKOTTA");
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_3.java

/**
 * Downgrade &lt;dachform&gt; elements to OpenImmo 1.2.2.
 * <p>//w ww .j av a  2  s  .c  om
 * The attributes "FLACHDACH", "PYRAMIDENDACH" for &lt;dachform&gt; elements
 * are not available in version 1.2.2.
 * <p>
 * Any occurences of these values are removed.
 *
 * @param doc OpenImmo document in version 1.2.3
 * @throws JaxenException
 */
protected void downgradeDachformElements(Document doc) throws JaxenException {
    List nodes = XmlUtils.newXPath(
            "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:dachform[@FLACHDACH or @PYRAMIDENDACH]",
            doc).selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        node.removeAttribute("FLACHDACH");
        node.removeAttribute("PYRAMIDENDACH");
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_3.java

/**
 * Downgrade &lt;kueche&gt; elements to OpenImmo 1.2.2.
 * <p>/* w  w w .j  av  a 2 s.c o m*/
 * The attribute "PANTRY" for &lt;kueche&gt; elements is not available in
 * version 1.2.2.
 * <p>
 * Any occurences of these values are removed.
 *
 * @param doc OpenImmo document in version 1.2.3
 * @throws JaxenException
 */
protected void downgradeKuecheElements(Document doc) throws JaxenException {
    List nodes = XmlUtils
            .newXPath("/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:kueche[@PANTRY]", doc)
            .selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        node.removeAttribute("PANTRY");
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_4.java

/**
 * Downgrade &lt;anhang&gt; elements to OpenImmo 1.2.3.
 * <p>//from  ww w. j a v  a2 s  .c  om
 * The options "QRCODE", "FILM", "FILMLINK" for the "gruppe" attribute of
 * &lt;anhang&gt; elements are not available in version 1.2.3.
 * <p>
 * The option "REMOTE" for the "location" attribute of
 * &lt;anhang&gt; elements is not available in version 1.2.3.
 * <p>
 * The the child element &lt;check&gt; of &lt;anhang&gt; elements is not
 * available in version 1.2.3.
 *
 * @param doc OpenImmo document in version 1.2.4
 * @throws JaxenException
 */
protected void downgradeAnhangElements(Document doc) throws JaxenException {
    List nodes = XmlUtils.newXPath("/io:openimmo/io:anbieter/io:anhang | "
            + "/io:openimmo/io:anbieter/io:immobilie/io:anhaenge/io:anhang", doc).selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;

        String value = StringUtils.trimToNull(node.getAttribute("gruppe"));
        if ("QRCODE".equalsIgnoreCase(value))
            node.removeAttribute("gruppe");
        else if ("FILM".equalsIgnoreCase(value))
            node.removeAttribute("gruppe");
        else if ("FILMLINK".equalsIgnoreCase(value))
            node.removeAttribute("gruppe");

        value = StringUtils.trimToNull(node.getAttribute("location"));
        if ("REMOTE".equalsIgnoreCase(value))
            node.setAttribute("location", "EXTERN");

        List childNodes = XmlUtils.newXPath("io:check", doc).selectNodes(node);
        for (Object childItem : childNodes) {
            node.removeChild((Node) childItem);
        }
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_4.java

/**
 * Downgrade &lt;bebaubar_nach&gt; elements to OpenImmo 1.2.3.
 * <p>//from w w w.j  a va2s .  c o  m
 * The option "LAENDERSPEZIFISCH" for the "bebaubar_attr" attribute of
 * &lt;bebaubar_nach&gt; elements is not available in version 1.2.3.
 * <p>
 * Any occurences of these values are removed.
 *
 * @param doc OpenImmo document in version 1.2.4
 * @throws JaxenException
 */
protected void downgradeBebaubarNachElements(Document doc) throws JaxenException {
    List nodes = XmlUtils.newXPath(
            "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:bebaubar_nach[@bebaubar_attr]", doc)
            .selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        String value = StringUtils.trimToNull(node.getAttribute("bebaubar_attr"));
        if ("LAENDERSPEZIFISCH".equalsIgnoreCase(value))
            node.removeAttribute("bebaubar_attr");
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_4.java

/**
 * Downgrade &lt;energietyp&gt; elements to OpenImmo 1.2.3.
 * <p>/*  ww w . j a  v a2 s.co  m*/
 * The attributes "KFW55", "KFW70" of &lt;energietyp&gt; elements are not
 * available in OpenImmo 1.2.3.
 *
 * @param doc OpenImmo document in version 1.2.4
 * @throws JaxenException
 */
protected void downgradeEnergietypElements(Document doc) throws JaxenException {
    List nodes = XmlUtils
            .newXPath("/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:energietyp[@KFW55 or @KFW70]",
                    doc)
            .selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        node.removeAttribute("KFW55");
        node.removeAttribute("KFW70");
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_4.java

/**
 * Downgrade &lt;grundstueck&gt; elements to OpenImmo 1.2.3.
 * <p>// ww w .  jav  a  2 s . c  o  m
 * The option "SEELIEGENSCHAFT" for the "grundst_typ" attribute of
 * &lt;grundstueck&gt; elements is not available in version 1.2.3.
 * <p>
 * Any occurence of these values is removed.
 *
 * @param doc OpenImmo document in version 1.2.4
 * @throws JaxenException
 */
protected void downgradeGrundstueckElements(Document doc) throws JaxenException {
    List nodes = XmlUtils.newXPath(
            "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:grundstueck[@grundst_typ]",
            doc).selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        String value = StringUtils.trimToNull(node.getAttribute("grundst_typ"));
        if ("SEELIEGENSCHAFT".equalsIgnoreCase(value))
            node.removeAttribute("grundst_typ");
    }
}

From source file:org.openestate.io.openimmo.converters.OpenImmo_1_2_5.java

/**
 * Downgrade &lt;bebaubar_nach&gt; elements to OpenImmo 1.2.4.
 * <p>/*from  w ww. ja  v a  2 s. co  m*/
 * The option "BAULAND_OHNE_B_PLAN" for the "bebaubar_attr" attribute of
 * &lt;bebaubar_nach&gt; elements is not available in version 1.2.4.
 * <p>
 * Any occurences of these values are removed.
 *
 * @param doc OpenImmo document in version 1.2.5
 * @throws JaxenException
 */
protected void downgradeBebaubarNachElements(Document doc) throws JaxenException {
    List nodes = XmlUtils.newXPath(
            "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:bebaubar_nach[@bebaubar_attr]", doc)
            .selectNodes(doc);
    for (Object item : nodes) {
        Element node = (Element) item;
        String value = StringUtils.trimToNull(node.getAttribute("bebaubar_attr"));
        if ("BAULAND_OHNE_B_PLAN".equalsIgnoreCase(value))
            node.removeAttribute("bebaubar_attr");
    }
}