Package org.w3c.dom

Examples of org.w3c.dom.DocumentFragment.appendChild()


                // If exception message contains info, it is included into failed
                Document       doc = DOMUtil.createDocument();
                authenticationFragment = doc.createDocumentFragment();

                Element      element = doc.createElementNS(null, "failed");
                authenticationFragment.appendChild(element);

                if (exceptionMsg != null) {
                    Text text = doc.createTextNode(exceptionMsg);
                    element.appendChild(text);
                }
View Full Code Here


                    element.appendChild(text);
                }

                if (data == null) {
                    element = doc.createElementNS(null, "data");
                    authenticationFragment.appendChild(element);
                    Text text = doc.createTextNode("No information");
                    element.appendChild(text);
                } else {
                    authenticationFragment.appendChild(doc.importNode(data, true));
                }
View Full Code Here

                    element = doc.createElementNS(null, "data");
                    authenticationFragment.appendChild(element);
                    Text text = doc.createTextNode("No information");
                    element.appendChild(text);
                } else {
                    authenticationFragment.appendChild(doc.importNode(data, true));
                }

            }
            if (this.getLogger().isDebugEnabled() == true) {
                this.getLogger().debug("end authentication");
View Full Code Here

                                                                                      null,
                                                                                      parameters,
                                                                                      this.resolver);
                    Document doc = org.apache.cocoon.components.source.SourceUtil.toDOM(source);
                    fragment = doc.createDocumentFragment();
                    fragment.appendChild(doc.getDocumentElement());
                } catch (SourceException se) {
                    throw org.apache.cocoon.components.source.SourceUtil.handle(se);
                } catch (IOException se) {
                    throw new ProcessingException(se);
                } catch (SAXException se) {
View Full Code Here

                getURLObject().toString();
            DocumentFragment result = null;
            try {
                Document d = df.createDocument(uri, new StringReader(text));
                result = doc.createDocumentFragment();
                result.appendChild(doc.importNode(d.getDocumentElement(),
                                                  true));
            } catch (Exception ex) {
                StringBuffer sb = new StringBuffer(text.length() +
                                                   FRAGMENT_PREFIX.length() +
                                                   "</svg>".length());
View Full Code Here

                         n != null;
                         n = n.getNextSibling()) {
                        if (n.getNodeType() == n.ELEMENT_NODE) {
                            n = doc.importNode(n, true);
                            result = doc.createDocumentFragment();
                            result.appendChild(n);
                            break;
                        }
                    }
                } catch (Exception exc) {
                    SAXDocumentFactory sdf = new SAXDocumentFactory
View Full Code Here

                         XMLResourceDescriptor.getXMLParserClassName());
                    try {
                        Document d = sdf.createDocument
                            (uri, new StringReader(text));
                        result = doc.createDocumentFragment();
                        result.appendChild(doc.importNode(d.getDocumentElement(), true));
                    } catch (Exception ext) {
                        if (userAgent != null)
                            userAgent.displayError(ext);
                    }
                }
View Full Code Here

            source = SourceUtil.getSource(location, typeParameters,
                                          parameters, resolver);
            Document doc = SourceUtil.toDOM(source);
            DocumentFragment fragment = doc.createDocumentFragment();

            fragment.appendChild(doc.getDocumentElement());

            return fragment;
        } catch (SourceException se) {
            throw SourceUtil.handle(se);
        } catch (IOException ce) {
View Full Code Here

            root.removeChild(child);
            // Leave out empty text nodes before any other node
            if (appendedNode == true
                || child.getNodeType() != Node.TEXT_NODE
                || child.getNodeValue().trim().length() > 0) {
                recordedDocFrag.appendChild(child);
                appendedNode = true;
            }
        }

        if (this.getLogger().isDebugEnabled() == true) {
View Full Code Here

        if (path == null || path.equals("") == true) {
            Document doc = DOMUtil.createDocument();
            result = doc.createDocumentFragment();
            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));
            }
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.