Example usage for org.dom4j Element elementIterator

List of usage examples for org.dom4j Element elementIterator

Introduction

In this page you can find the example usage for org.dom4j Element elementIterator.

Prototype

Iterator<Element> elementIterator();

Source Link

Document

Returns an iterator over all this elements child elements.

Usage

From source file:fr.gouv.culture.vitam.utils.XmlDom.java

License:Open Source License

public final static void removeEmptyElement(Element root) {
    // look first at attribute
    if (root.attributeCount() > 0) {
        @SuppressWarnings("unchecked")
        Iterator<Attribute> attribs = root.attributeIterator();
        while (attribs.hasNext()) {
            Attribute attribute = (Attribute) attribs.next();
            removeEmptyAttribute(attribute);
        }//w ww  . java2 s.  c o  m
    }
    @SuppressWarnings("unchecked")
    Iterator<Element> elements = root.elementIterator();
    while (elements.hasNext()) {
        Element elt = (Element) elements.next();
        // look at its descendant
        removeEmptyElement(elt);
        if (elt.attributeCount() > 0) {
            continue;
        }
        if (elt.hasContent()) {
            continue;
        }
        elt.detach();
    }
}

From source file:fr.gouv.vitam.xml.XmlDom4jTools.java

License:Open Source License

public final static void removeEmptyElement(Element root) {
    // look first at attribute
    if (root.attributeCount() > 0) {
        @SuppressWarnings("unchecked")
        Iterator<Attribute> attribs = root.attributeIterator();
        List<Attribute> toremove = new ArrayList<>();
        while (attribs.hasNext()) {
            Attribute attribute = (Attribute) attribs.next();
            if (attribute.getValue().length() == 0) {
                toremove.add(attribute);
            }//from  ww w.  j  a  v  a2  s.  c o m
            //removeEmptyAttribute(attribute);
        }
        for (Attribute attribute : toremove) {
            root.remove(attribute);
        }
        toremove.clear();
    }
    @SuppressWarnings("unchecked")
    Iterator<Element> elements = root.elementIterator();
    List<Element> toremove = new ArrayList<>();
    while (elements.hasNext()) {
        Element elt = (Element) elements.next();
        // look at its descendant
        removeEmptyElement(elt);
        if (elt.attributeCount() > 0) {
            continue;
        }
        if (elt.hasContent()) {
            continue;
        }
        toremove.add(elt);
        //elt.detach();
    }
    for (Element element : toremove) {
        root.remove(element);
    }
    toremove.clear();
}

From source file:gov.nih.nci.grididloader.Config.java

License:BSD License

/**
 * Loads the entity mapping from an XML document DOM.
 * @throws Exception/*ww  w  .  j a  v  a2  s  .c  o  m*/
 */
public void loadXMLMapping(Document xmlMappingDoc) throws Exception {

    final Element mapping = xmlMappingDoc.getRootElement();
    final String mappingPackage = mapping.attribute("package").getText();

    // Damn you 1.4 iteration API!
    Iterator elementIterator = mapping.elementIterator();

    Map<String, BigEntity> entityMap = new HashMap<String, BigEntity>();

    // for each <entity>
    while (elementIterator.hasNext()) {
        final Element entityElement = (Element) elementIterator.next();
        final String className = entityElement.attribute("class").getText();
        final String tableName = entityElement.attribute("table").getText();
        final boolean serial = (entityElement.attribute("parallel") != null)
                && "false".equals(entityElement.attribute("parallel").getText());
        final String primaryKey = entityElement.element("primary-key").getText();
        final Element logicalElement = entityElement.element("logical-key");

        final Map<String, Join> joinMap = new HashMap<String, Join>();
        final Collection<Join> joins = new ArrayList<Join>();
        final List<String> attributeList = new ArrayList<String>();

        // use the sb to create commaDelimitedFields
        final StringBuffer sb = new StringBuffer(tableName);
        sb.append(".");
        sb.append(primaryKey);

        // for each <property>
        final Iterator logicalIterator = logicalElement.elementIterator();
        while (logicalIterator.hasNext()) {

            final Element propertyElement = (Element) logicalIterator.next();
            final String attr = propertyElement.getText();
            final Attribute foreignTableAttr = propertyElement.attribute("table");
            final Attribute foreignEntityAttr = propertyElement.attribute("entity");

            // comma before every logical key property
            sb.append(",");

            // foreign attribute?
            if (foreignTableAttr != null) {
                final String foreignKey = propertyElement.attribute("foreign-key").getText();
                final String foreignTable = foreignTableAttr.getText();
                final String foreignTablePK = propertyElement.attribute("primary-key").getText();

                TableJoin join = null;
                // have we already seen this join on this foreign key?
                String key = foreignTable + "~" + foreignKey;
                if (joinMap.containsKey(key)) {
                    join = (TableJoin) joinMap.get(key);
                } else {
                    join = new TableJoin(foreignKey, foreignTable, foreignTablePK);
                    joinMap.put(key, join);
                    joins.add(join);
                }

                // add this attribute to the join
                join.addAttribute(attr);
            }
            // join to an entire entity 
            else if (foreignEntityAttr != null) {
                final String foreignKey = propertyElement.attribute("foreign-key").getText();
                final String foreignEntity = foreignEntityAttr.getText();
                BigEntity joinEntity = entityMap.get(foreignEntity);
                if (joinEntity == null) {
                    System.err.println("ERROR: Invalid reference to " + foreignEntity + " in " + className);
                } else {
                    Join join = new EntityJoin(foreignKey, joinEntity);
                    joins.add(join);
                }
            }
            // a regular attribute
            else {
                attributeList.add(attr);
            }
        }

        String[] attributes = new String[attributeList.size()];
        attributeList.toArray(attributes);

        BigEntity entity = new BigEntity(tableName, mappingPackage, className, primaryKey, attributes, joins,
                !serial);
        entities.add(entity);
        entityMap.put(entity.getClassName(), entity);
    }
}

From source file:gr.omadak.leviathan.asp.objects.XmlObjectParser.java

License:Open Source License

private List getArgs(Element el) throws DocumentException {
    List result = new ArrayList();
    for (Iterator it = el.elementIterator(); it.hasNext();) {
        Element arg = (Element) it.next();
        if ("arg".equals(arg.getName())) {
            String type = arg.attributeValue("type");
            assertValue(type, "Type of arg is required");
            int objType = getType(type);
            result.add(new Integer(objType));
        } else if ("args".equals(arg.getName())) {
            result.add(new Integer(CommonConstants.ALL_ARGS));
        }/* w w w.jav  a  2s  . co m*/
    }
    return result;
}

From source file:gr.omadak.leviathan.asp.objects.XmlObjectParser.java

License:Open Source License

private AST translate(Element el, AST root, boolean evalFirstLevelArgs, int cDepth) throws DocumentException {
    List astChildren = new ArrayList();
    boolean firstAST = cDepth > 0;
    for (Iterator it = el.elementIterator(); it.hasNext();) {
        Element ch = (Element) it.next();
        if ("ast".equals(ch.getName())) {
            firstAST = true;/*from w ww  .j  a v a  2 s.co m*/
            String type = ch.attributeValue("name");
            String text = ch.attributeValue("text");
            assertValue(type, "Name of ast elements is required");
            text = text == null ? type : text;
            int dType = getType(type);
            AST node = createNode(dType, text);
            if (ch.elementIterator().hasNext()) {
                translate(ch, node, evalFirstLevelArgs, cDepth + 1);
            }
            astChildren.add(node);
        } else if ("arg".equals(ch.getName())) {
            if (root == null) {
                if (evalFirstLevelArgs) {
                    String type = ch.attributeValue("type");
                    assertValue(type, "Type of arg is required");
                    int objType = getType(type);
                    lastArgType = objType;
                }
            } else {
                String index = ch.attributeValue("index");
                assertValue(index, "Argument index should be specified");
                try {
                    Integer.parseInt(index);
                } catch (NumberFormatException nfe) {
                    throw new DocumentException(url + " : Invalid value:" + index + " for attribute index");
                }
                astChildren.add(createNode(astArgType, index));
            }
        } else if ("args".equals(ch.getName())) {
            if (firstAST) {
                astChildren.add(ch.attributeValue("mode") == null ? factory.create(CommonConstants.ALL_ARGS)
                        : createNode(CommonConstants.ALL_ARGS, ch.attributeValue("mode")));
            }
        } else if ("this".equals(ch.getName())) {
            astChildren.add(createNode(CommonConstants.INSTANCE, "this"));
        } else if ("state".equals(ch.getName())) {
            String id = ch.attributeValue("methodId");
            assertValue(id, "The id of the method affected is not defined");
            String index = ch.attributeValue("index");
            assertValue(index, "The index of the argument for the affected method " + "is not defined");
            try {
                lastIndex = Integer.parseInt(index) - 1;
            } catch (NumberFormatException nfe) {
                throw new DocumentException("The index for the affected mathod is invalid:" + index);
            }
            lastState = id;
        } else {
            System.err.println("Unexpected element:" + ch.getName());
        }
    }
    if (astChildren.isEmpty()) {
        return null;
    }
    if (root == null && astChildren.size() > 1) {
        root = createNode(translateRoot, "TRANSLATE_ROOT");
    }
    AST current = null;
    for (Iterator it = astChildren.iterator(); it.hasNext();) {
        if (root == null) {
            root = (AST) it.next();
        } else if (root.getFirstChild() == null) {
            current = (AST) it.next();
            root.setFirstChild(current);
        } else {
            if (current == null) {
                current = root.getFirstChild();
            }
            AST next = (AST) it.next();
            current.setNextSibling(next);
            current = next;
        }
    }
    return root;
}

From source file:hello.SampleSimpleApplication.java

License:Apache License

private void addAutoTile(Document domFromStream) {
    DOMElement autoTileElement1 = (DOMElement) domFromStream
            .selectSingleNode("/html/body//div[@id='page1-div']");
    Element autoTileElement = autoTileElement1;
    if (autoTileElement != null) {
        autoTileElement.attribute("id").setValue("auto_tile_" + autoTileNr);
        changeImgUrl(autoTileElement);// ww  w  .  j av a2  s . c om
        addBreadcrumbBefore(autoTileElement1);
        cleanSymbols(autoTileElement);

        Element detach = (Element) autoTileElement.detach();
        autoDocBody.add(detach);
    } else {
        //audi
        Element autoTileElementFromStream = (Element) domFromStream
                .selectSingleNode("/html/body/div/table//td[div/h2]");
        changeImgUrl(autoTileElementFromStream);
        /*
        Element autoTileNameElement = (Element) autoTileElement2.selectSingleNode("div/h2");
        autoTileNameElement.setText(autoTileName);
         * */

        /*
         * */
        List<Element> breadcrumOld = autoTileElementFromStream.selectNodes("div/h3");
        for (Element element : breadcrumOld) {
            element.detach();
        }
        autoTileElement = autoDocBody.addElement("div");
        autoTileElement.addAttribute("id", "auto_tile_" + autoTileNr);
        addBreadcrumb(autoTileElement);

        cleanSymbols(autoTileElementFromStream);
        for (Iterator iterator = autoTileElementFromStream.elementIterator(); iterator.hasNext();) {
            Element element = (Element) iterator.next();
            autoTileElement.add(element.detach());
        }

    }
    /* neccesary
     * */
}

From source file:hvv_admin.HVV_AdminSettings.java

private boolean ReadSettings() {
    boolean bResOk = true;
    try {//w ww.  j a  va2s.  c  o m
        SAXReader reader = new SAXReader();

        String strSettingsFilePathName = System.getenv("AMS_ROOT") + "/etc/settings.admin.xml";
        URL url = (new java.io.File(strSettingsFilePathName)).toURI().toURL();

        Document document = reader.read(url);

        Element root = document.getRootElement();

        // iterate through child elements of root
        for (Iterator i = root.elementIterator(); i.hasNext();) {
            Element element = (Element) i.next();
            String name = element.getName();
            String value = element.getText();

            //logger.debug( "Pairs: [" + name + " : " + value + "]");

            if ("poller.host".equals(name))
                m_strPollerPartHost = value;
            if ("poller.port".equals(name))
                m_nPollerPartPort = Integer.parseInt(value);

            if ("executor.to.host".equals(name))
                m_strExecToPartHost = value;
            if ("executor.to.port".equals(name))
                m_nExecToPartPort = Integer.parseInt(value);

            if ("executor.from.host".equals(name))
                m_strExecFromPartHost = value;
            if ("executor.from.port".equals(name))
                m_nExecFromPartPort = Integer.parseInt(value);

            //if( "hv.host".equals( name)) m_strPollerPartHost = value;
            //if( "hv.port".equals( name)) m_nPollerPartPort = Integer.parseInt( value);

            if ("timezone".equals(name))
                m_nTimeZoneShift = Integer.parseInt(value);

            if ("debug.shorten.program.items".equals(name)) {
                if ("true".equals(value))
                    m_bDebugShortenProgItems = true;
            }

            if ("debug.shorten.program.times".equals(name)) {
                if ("true".equals(value))
                    m_bDebugShortenProgTimes = true;
            }

            if ("use.planner".equals(name)) {
                if ("true".equals(value))
                    m_bUsePlanner = true;
            }
        }

    } catch (MalformedURLException ex) {
        logger.error("MalformedURLException caught while loading settings!", ex);
        bResOk = false;
    } catch (DocumentException ex) {
        logger.error("DocumentException caught while loading settings!", ex);
        bResOk = false;
    }

    return bResOk;
}

From source file:hvv_admin.HVV_AdminSettings.java

public boolean ReadSettingsDbg() {
    boolean bResOk = true;
    try {//from   w  ww  . j  a va2  s  .co  m
        SAXReader reader = new SAXReader();

        String strSettingsFilePathName = System.getenv("AMS_ROOT") + "/etc/settings.admin.xml";
        URL url = (new java.io.File(strSettingsFilePathName)).toURI().toURL();

        Document document = reader.read(url);

        Element root = document.getRootElement();

        // iterate through child elements of root
        for (Iterator i = root.elementIterator(); i.hasNext();) {
            Element element = (Element) i.next();
            String name = element.getName();
            String value = element.getText();

            //logger.debug( "Pairs: [" + name + " : " + value + "]");

            if ("debug.shorten.program.items".equals(name)) {
                if ("true".equals(value))
                    m_bDebugShortenProgItems = true;
                else
                    m_bDebugShortenProgItems = false;

            }

            if ("debug.shorten.program.times".equals(name)) {
                if ("true".equals(value))
                    m_bDebugShortenProgTimes = true;
                else
                    m_bDebugShortenProgTimes = false;
            }
        }

    } catch (MalformedURLException ex) {
        logger.error("MalformedURLException caught while loading settings!", ex);
        bResOk = false;
    } catch (DocumentException ex) {
        logger.error("DocumentException caught while loading settings!", ex);
        bResOk = false;
    }

    return bResOk;
}

From source file:hvv_admin.HVV_AdminStepNames.java

private boolean ReadSettings() {
    boolean bResOk = true;
    try {//  w  w w.  j  a v  a  2s . c o m
        SAXReader reader = new SAXReader();

        String strSettingsFilePathName = System.getenv("AMS_ROOT") + "/etc/hvv8.step.names.xml";
        URL url = (new java.io.File(strSettingsFilePathName)).toURI().toURL();

        Document document = reader.read(url);

        Element root = document.getRootElement();

        // iterate through child elements of root
        for (Iterator i = root.elementIterator(); i.hasNext();) {
            Element element = (Element) i.next();
            String id = element.attributeValue("id");
            String num = element.attributeValue("num");
            String value = element.getText();
            m_mapSteps.put(id, new ItemStepNames(num, value));
        }

    } catch (MalformedURLException ex) {
        logger.error("MalformedURLException caught while loading settings!", ex);
        bResOk = false;
    } catch (DocumentException ex) {
        logger.error("DocumentException caught while loading settings!", ex);
        bResOk = false;
    }

    return bResOk;
}

From source file:hvv_admin4.HVV_Admin4Settings.java

private boolean ReadSettings() {
    boolean bResOk = true;
    try {//w  w w  .  jav a 2  s  .co  m
        SAXReader reader = new SAXReader();

        String strWorkingDir = System.getenv("AMS_ROOT");
        String strRelFilePath = "etc" + File.separator + "settings.admin4.xml";

        File fileSettings = new java.io.File(strWorkingDir, strRelFilePath);
        Document document = reader.read(fileSettings);

        Element root = document.getRootElement();

        // iterate through child elements of root
        for (Iterator i = root.elementIterator(); i.hasNext();) {
            Element element = (Element) i.next();
            String name = element.getName();
            String value = element.getText();

            //logger.debug( "Pairs: [" + name + " : " + value + "]");

            if ("timezone".equals(name))
                m_nTimeZoneShift = Integer.parseInt(value);

            //<!-- ?  ? ( ?) -->
            if ("processing.time.2".equals(name))
                m_nProcessingTime_2 = Integer.parseInt(value);

            //<!-- ?  ?- ( ?) -->
            if ("processing.time.3".equals(name))
                m_nProcessingTime_3 = Integer.parseInt(value);

            //<!-- ?   ( ?) -->
            if ("processing.time.6".equals(name))
                m_nProcessingTime_6 = Integer.parseInt(value);

            //<!-- ?   ?? ( ?) -->
            if ("processing.time.8".equals(name))
                m_nProcessingTime_8 = Integer.parseInt(value);

            //<!-- ?  ( ?) -->
            if ("excerpt.time".equals(name))
                m_nExcerptTime = Integer.parseInt(value);

            //<!-- ?  ( ?) -->
            if ("mainwnd.hor.gap".equals(name))
                m_nMainWndHorGap = Integer.parseInt(value);

            //<!-- ?  ( ?) -->
            if ("mainwnd.ver.gap".equals(name))
                m_nMainWndVerGap = Integer.parseInt(value);

            //<!--        ?   -->
            if ("RemoteReportsPath".equals(name))
                m_strRemoteReportsPath = value;

            //<!-- ??:   -->
            if ("debug.report".equals(name)) {
                if ("true".equals(value))
                    m_bDebugReport = true;
            }

            //<!-- ??: ? ?   ?   -->
            if ("debug.shorten.program.items".equals(name)) {
                if ("true".equals(value))
                    m_bDebugShortenProgItems = true;
            }

            //<!-- ??: ? ?   ?   -->
            if ("debug.shorten.program.times".equals(name)) {
                if ("true".equals(value))
                    m_bDebugShortenProgTimes = true;
            }

            //<!-- ??: ?   -->
            if ("debug.shorten.thermoprocessing".equals(name)) {
                if ("true".equals(value))
                    m_bDebugShortenThermoProcessing = true;
            }

            //? 
            if ("use.planner".equals(name)) {
                if ("true".equals(value))
                    m_bUsePlanner = true;
            }

            //<!--? ? ? 1 -->
            if ("Coeff.U.1000.ARM1".equals(name))
                m_dblCoeffU1000_ARM1 = Double.parseDouble(value);
            if ("Coeff.U.1100.ARM1".equals(name))
                m_dblCoeffU1100_ARM1 = Double.parseDouble(value);
            if ("Coeff.U.1200.ARM1".equals(name))
                m_dblCoeffU1200_ARM1 = Double.parseDouble(value);
            if ("Coeff.U.2500.ARM1".equals(name))
                m_dblCoeffU2500_ARM1 = Double.parseDouble(value);

            //<!--? ? ? 2 -->
            if ("Coeff.U.1000.ARM2".equals(name))
                m_dblCoeffU1000_ARM2 = Double.parseDouble(value);
            if ("Coeff.U.1100.ARM2".equals(name))
                m_dblCoeffU1100_ARM2 = Double.parseDouble(value);
            if ("Coeff.U.1200.ARM2".equals(name))
                m_dblCoeffU1200_ARM2 = Double.parseDouble(value);
            if ("Coeff.U.2500.ARM2".equals(name))
                m_dblCoeffU2500_ARM2 = Double.parseDouble(value);

            //<!--? ? ? 3 -->
            if ("Coeff.U.1000.ARM3".equals(name))
                m_dblCoeffU1000_ARM3 = Double.parseDouble(value);
            if ("Coeff.U.1100.ARM3".equals(name))
                m_dblCoeffU1100_ARM3 = Double.parseDouble(value);
            if ("Coeff.U.1200.ARM3".equals(name))
                m_dblCoeffU1200_ARM3 = Double.parseDouble(value);
            if ("Coeff.U.2500.ARM3".equals(name))
                m_dblCoeffU2500_ARM3 = Double.parseDouble(value);

            //<!--? ? ? 4 -->
            if ("Coeff.U.1000.ARM4".equals(name))
                m_dblCoeffU1000_ARM4 = Double.parseDouble(value);
            if ("Coeff.U.1100.ARM4".equals(name))
                m_dblCoeffU1100_ARM4 = Double.parseDouble(value);
            if ("Coeff.U.1200.ARM4".equals(name))
                m_dblCoeffU1200_ARM4 = Double.parseDouble(value);
            if ("Coeff.U.2500.ARM4".equals(name))
                m_dblCoeffU2500_ARM4 = Double.parseDouble(value);

            //?? ?  ??  ?
            // 
            //? 2 ? (? ?)
            if ("Puff.2.Message0.small".equals(name))
                m_strPuff2Message0_small = value;
            if ("Puff.2.Message1.small".equals(name))
                m_strPuff2Message1_small = value;
            if ("Puff.2.Message2.small".equals(name))
                m_strPuff2Message2_small = value;
            if ("Puff.2.Message3.small".equals(name))
                m_strPuff2Message3_small = value;

            //? 3 ? (? ?-)
            if ("Puff.3.Message0.small".equals(name))
                m_strPuff3Message0_small = value;
            if ("Puff.3.Message1.small".equals(name))
                m_strPuff3Message1_small = value;
            if ("Puff.3.Message2.small".equals(name))
                m_strPuff3Message2_small = value;
            if ("Puff.3.Message3.small".equals(name))
                m_strPuff3Message3_small = value;

            //? 4 ? (? ?-)
            if ("Puff.4.Message0.small".equals(name))
                m_strPuff4Message0_small = value;
            if ("Puff.4.Message1.small".equals(name))
                m_strPuff4Message1_small = value;
            if ("Puff.4.Message2.small".equals(name))
                m_strPuff4Message2_small = value;
            if ("Puff.4.Message3.small".equals(name))
                m_strPuff4Message3_small = value;

            //? 6 ? ( )
            if ("Puff.6.Message0.small".equals(name))
                m_strPuff6Message0_small = value;
            if ("Puff.6.Message1.small".equals(name))
                m_strPuff6Message1_small = value;
            if ("Puff.6.Message2.small".equals(name))
                m_strPuff6Message2_small = value;
            if ("Puff.6.Message3.small".equals(name))
                m_strPuff6Message3_small = value;

            //? 8 ? ( )
            if ("Puff.8.Message0.small".equals(name))
                m_strPuff8Message0_small = value;
            if ("Puff.8.Message1.small".equals(name))
                m_strPuff8Message1_small = value;
            if ("Puff.8.Message2.small".equals(name))
                m_strPuff8Message2_small = value;
            if ("Puff.8.Message3.small".equals(name))
                m_strPuff8Message3_small = value;

            //? 10 ? ( )
            if ("Puff.10.Message0.small".equals(name))
                m_strPuff10Message0_small = value;
            if ("Puff.10.Message1.small".equals(name))
                m_strPuff10Message1_small = value;
            if ("Puff.10.Message2.small".equals(name))
                m_strPuff10Message2_small = value;
            if ("Puff.10.Message3.small".equals(name))
                m_strPuff10Message3_small = value;

            //?? ?  ??  ?
            //  ()
            //? 2 ? (? ?)
            if ("Puff.2.Message0.medium".equals(name))
                m_strPuff2Message0_medium = value;
            if ("Puff.2.Message1.medium".equals(name))
                m_strPuff2Message1_medium = value;
            if ("Puff.2.Message2.medium".equals(name))
                m_strPuff2Message2_medium = value;
            if ("Puff.2.Message3.medium".equals(name))
                m_strPuff2Message3_medium = value;

            //? 3 ? (? ?-)
            if ("Puff.3.Message0.medium".equals(name))
                m_strPuff3Message0_medium = value;
            if ("Puff.3.Message1.medium".equals(name))
                m_strPuff3Message1_medium = value;
            if ("Puff.3.Message2.medium".equals(name))
                m_strPuff3Message2_medium = value;
            if ("Puff.3.Message3.medium".equals(name))
                m_strPuff3Message3_medium = value;

            //? 4 ? (? ?-)
            if ("Puff.4.Message0.medium".equals(name))
                m_strPuff4Message0_medium = value;
            if ("Puff.4.Message1.medium".equals(name))
                m_strPuff4Message1_medium = value;
            if ("Puff.4.Message2.medium".equals(name))
                m_strPuff4Message2_medium = value;
            if ("Puff.4.Message3.medium".equals(name))
                m_strPuff4Message3_medium = value;

            //? 6 ? ( )
            if ("Puff.6.Message0.medium".equals(name))
                m_strPuff6Message0_medium = value;
            if ("Puff.6.Message1.medium".equals(name))
                m_strPuff6Message1_medium = value;
            if ("Puff.6.Message2.medium".equals(name))
                m_strPuff6Message2_medium = value;
            if ("Puff.6.Message3.medium".equals(name))
                m_strPuff6Message3_medium = value;

            //? 8 ? ( )
            if ("Puff.8.Message0.medium".equals(name))
                m_strPuff8Message0_medium = value;
            if ("Puff.8.Message1.medium".equals(name))
                m_strPuff8Message1_medium = value;
            if ("Puff.8.Message2.medium".equals(name))
                m_strPuff8Message2_medium = value;
            if ("Puff.8.Message3.medium".equals(name))
                m_strPuff8Message3_medium = value;

            //? 10 ? ( )
            if ("Puff.10.Message0.medium".equals(name))
                m_strPuff10Message0_medium = value;
            if ("Puff.10.Message1.medium".equals(name))
                m_strPuff10Message1_medium = value;
            if ("Puff.10.Message2.medium".equals(name))
                m_strPuff10Message2_medium = value;
            if ("Puff.10.Message3.medium".equals(name))
                m_strPuff10Message3_medium = value;

            //?? ?  ??  ?
            //   ()
            //? 2 ? (? ?)
            if ("Puff.2.Message0.big".equals(name))
                m_strPuff2Message0_big = value;
            if ("Puff.2.Message1.big".equals(name))
                m_strPuff2Message1_big = value;
            if ("Puff.2.Message2.big".equals(name))
                m_strPuff2Message2_big = value;
            if ("Puff.2.Message3.big".equals(name))
                m_strPuff2Message3_big = value;

            //? 3 ? (? ?-)
            if ("Puff.3.Message0.big".equals(name))
                m_strPuff3Message0_big = value;
            if ("Puff.3.Message1.big".equals(name))
                m_strPuff3Message1_big = value;
            if ("Puff.3.Message2.big".equals(name))
                m_strPuff3Message2_big = value;
            if ("Puff.3.Message3.big".equals(name))
                m_strPuff3Message3_big = value;

            //? 4 ? (? ?-)
            if ("Puff.4.Message0.big".equals(name))
                m_strPuff4Message0_big = value;
            if ("Puff.4.Message1.big".equals(name))
                m_strPuff4Message1_big = value;
            if ("Puff.4.Message2.big".equals(name))
                m_strPuff4Message2_big = value;
            if ("Puff.4.Message3.big".equals(name))
                m_strPuff4Message3_big = value;

            //? 6 ? ( )
            if ("Puff.6.Message0.big".equals(name))
                m_strPuff6Message0_big = value;
            if ("Puff.6.Message1.big".equals(name))
                m_strPuff6Message1_big = value;
            if ("Puff.6.Message2.big".equals(name))
                m_strPuff6Message2_big = value;
            if ("Puff.6.Message3.big".equals(name))
                m_strPuff6Message3_big = value;

            //? 8 ? ( )
            if ("Puff.8.Message0.big".equals(name))
                m_strPuff8Message0_big = value;
            if ("Puff.8.Message1.big".equals(name))
                m_strPuff8Message1_big = value;
            if ("Puff.8.Message2.big".equals(name))
                m_strPuff8Message2_big = value;
            if ("Puff.8.Message3.big".equals(name))
                m_strPuff8Message3_big = value;

            //? 10 ? ( )
            if ("Puff.10.Message0.big".equals(name))
                m_strPuff10Message0_big = value;
            if ("Puff.10.Message1.big".equals(name))
                m_strPuff10Message1_big = value;
            if ("Puff.10.Message2.big".equals(name))
                m_strPuff10Message2_big = value;
            if ("Puff.10.Message3.big".equals(name))
                m_strPuff10Message3_big = value;
        }

    } catch (DocumentException ex) {
        logger.error("DocumentException caught while loading settings!", ex);
        bResOk = false;
    }

    return bResOk;
}