Package org.w3c.dom

Examples of org.w3c.dom.Document.importNode()


            this.getLayoutDOM();
            if (this.layoutDOM != null) {
                result.appendChild(doc.importNode(this.layoutDOM.getDocumentElement(), true));
            }
            if (this.configurationDOM != null) {
                result.appendChild(doc.importNode(this.configurationDOM.getDocumentElement(), true));
            }

            if (this.statusProfile != null) {
                if (this.copletID != null && this.copletNumber != null) {
                    String statusPath = "customization/coplet[@id='"+copletID+"' and @number='"+copletNumber+"']";
View Full Code Here


                        if (node != null) {
                            Element copletData = doc.createElementNS(null, "coplet-data");
                            NodeList childs = node.getChildNodes();
                            if (childs != null) {
                                for(int l=0; l<childs.getLength(); l++) {
                                    copletData.appendChild(doc.importNode(childs.item(l), true));
                                }
                            }
                            result.appendChild(copletData);
                        }
                    } catch (javax.xml.transform.TransformerException localException) {
View Full Code Here

                    // now we have an element
                    // copy all children of this element in the resulting tree
                    NodeList childs = list.item(i).getChildNodes();
                    if (childs != null) {
                        for(int m = 0; m < childs.getLength(); m++) {
                            result.appendChild(doc.importNode(childs.item(m), true));
                        }
                    }
                }
            }
        }
View Full Code Here

        // now create the base profile containing the above profiles
        profileDoc = DOMUtil.createDocument();
        profile = profileDoc.createDocumentFragment();
        profileRoot = profileDoc.createElementNS(null, "profile");
        profile.appendChild(profileRoot);
        profileRoot.appendChild(profileDoc.importNode(DOMUtil.selectSingleNode(layoutFragment,
                                                                  "layout-profile"), true));
        profileRoot.appendChild(profileDoc.importNode(DOMUtil.selectSingleNode(copletsFragment,
                                                                  "coplets-profile"), true));

        // if avalailable append the type profile
View Full Code Here

        profile = profileDoc.createDocumentFragment();
        profileRoot = profileDoc.createElementNS(null, "profile");
        profile.appendChild(profileRoot);
        profileRoot.appendChild(profileDoc.importNode(DOMUtil.selectSingleNode(layoutFragment,
                                                                  "layout-profile"), true));
        profileRoot.appendChild(profileDoc.importNode(DOMUtil.selectSingleNode(copletsFragment,
                                                                  "coplets-profile"), true));

        // if avalailable append the type profile
        if (adminProfile == true) {
            res = (String)config.get(PortalConstants.CONF_ADMIN_TYPE_BASE);
View Full Code Here

            }
            typeFragment = SourceUtil.readDOM(res,
                                   null,
                                   pars,
                                   this.resolver);
            profileRoot.appendChild(profileDoc.importNode(DOMUtil.selectSingleNode(typeFragment,
                              "type-profile"), true));

            if (this.getLogger().isDebugEnabled() == true) {
                this.getLogger().debug("type base profile loaded");
            }
View Full Code Here

    case org.w3c.dom.Node.CDATA_SECTION_NODE:
    case org.w3c.dom.Node.COMMENT_NODE:
    case org.w3c.dom.Node.ENTITY_REFERENCE_NODE:
    case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:
        mid = doc.createElementNS(null, "__dummy__");
        mid.appendChild(doc.importNode(node, true));
        doc.getDocumentElement().appendChild(mid);
        ++n;
        break;
    case org.w3c.dom.Node.ATTRIBUTE_NODE:
        // The mid element also serves as a container for
View Full Code Here

    case org.w3c.dom.Node.ATTRIBUTE_NODE:
        // The mid element also serves as a container for
        // attributes, avoiding problems with conflicting
        // attributes or node order.
        mid = doc.createElementNS(null, "__dummy__");
        mid.setAttributeNodeNS((Attr)doc.importNode(node, true));
        doc.getDocumentElement().appendChild(mid);
        ++n;
        break;
    default:
        // Better play it safe for all types we aren't sure we know
View Full Code Here

        DocumentFragment fragment = digester.parse( new StringReader( TEST_XML ) );

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.newDocument();
        Node importedFragment = doc.importNode( fragment, true );
        doc.appendChild( doc.createElement( "root" ) );
        doc.getFirstChild().appendChild( importedFragment );

    }
View Full Code Here

        copyInto(n);
        if (deep) {
            for (Node c = getFirstChild();
                 c != null;
                 c = c.getNextSibling()) {
                n.appendChild(n.importNode(c, deep));
            }
        }
        return n;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.