Package org.w3c.dom

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


        //Don't inject DOCTYPE if QName is null
        if(doctype_qname != null){
          DocumentType docTypeNode = document.getImplementation()
              .createDocumentType(doctype_qname, doctype_pubid, doctype_sysid);
          if(document.getDoctype() != null){
            document.removeChild(document.getDoctype());
          }
          document.insertBefore(docTypeNode, document.getFirstChild());
        }
      }
View Full Code Here


                } catch (TransformerConfigurationException e) {
                    throw new SAXException("Error creating a new TransformerHandler", e);
                }
                Document doc = domImplementation.createDocument(uri, qName, null);
                //It's easier to work with an empty document, so remove the root element
                doc.removeChild(doc.getDocumentElement());
                handler.setResult(new DOMResult(doc));
                Area parent = (Area)areaStack.peek();
                ((ForeignObject)parent).setDocument(doc);

                //activate delegate for nested foreign document
View Full Code Here

   */
  public Element transformDomToDom(Element source)
      throws TransformerException {
    // create document
    Document document = DomHelper.createDocument("", "dummy");
    document.removeChild(document.getDocumentElement());

    Source xmlSource = new DOMSource(source);
    Result outputTarget = new DOMResult(document);
    transformer.transform(xmlSource, outputTarget);

View Full Code Here

        //Don't inject DOCTYPE if QName is null
        if(doctype_qname != null){
          DocumentType docTypeNode = document.getImplementation()
              .createDocumentType(doctype_qname, doctype_pubid, doctype_sysid);
          if(document.getDoctype() != null){
            document.removeChild(document.getDoctype());
          }
          document.insertBefore(docTypeNode, document.getFirstChild());
        }
      }
View Full Code Here

                } catch (TransformerConfigurationException e) {
                    throw new SAXException("Error creating a new TransformerHandler", e);
                }
                Document doc = domImplementation.createDocument(uri, qName, null);
                //It's easier to work with an empty document, so remove the root element
                doc.removeChild(doc.getDocumentElement());
                handler.setResult(new DOMResult(doc));
                Area parent = (Area)areaStack.peek();
                ((ForeignObject)parent).setDocument(doc);
               
                //activate delegate for nested foreign document
View Full Code Here

            //temporary marker to make sure recursive imports don't blow up
            schemaMap.put(file, null);

            Document doc = StaxUtils.read(ins);
            Element elem = doc.getDocumentElement();
            doc.removeChild(elem);
           
            if ("schema".equals(elem.getLocalName())
                && "http://www.w3.org/2001/XMLSchema".equals(elem.getNamespaceURI())) {
                return addSchemaElement(sts, doc, elem, file);
            }
View Full Code Here

                } catch (TransformerConfigurationException e) {
                    throw new SAXException("Error creating a new TransformerHandler", e);
                }
                Document doc = domImplementation.createDocument(uri, qName, null);
                //It's easier to work with an empty document, so remove the root element
                doc.removeChild(doc.getDocumentElement());
                handler.setResult(new DOMResult(doc));
                Area parent = (Area)areaStack.peek();
                ((ForeignObject)parent).setDocument(doc);

                //activate delegate for nested foreign document
View Full Code Here

                    ProbeMatchesType pmt = handleProbe((ProbeType)obj);
                    if (pmt == null) {
                        return null;
                    }
                    if (mapToOld) {
                        doc.removeChild(doc.getDocumentElement());
                        DOMResult result = new DOMResult(doc);
                        XMLStreamWriter r = StaxUtils.createXMLStreamWriter(result);
                        context.createMarshaller().marshal(factory.createProbeMatches(pmt), r);
                       
                        XMLStreamReader domReader = StaxUtils.createXMLStreamReader(doc);
View Full Code Here

           session.getUserAgent().indexOf("MSIE") != -1)
        {
            // Removing <!DOCTYPE> sets Internet Explorer in Quirks Mode.
            // Quirks mode is mandatory with SVG inline and ASV
            DocumentType docType = doc.getDoctype();
            doc.removeChild(docType);
        }

        this.svgElem = doc.getElementById("svgId");
        ParamTransport[] params = new ParamTransport[]
            { new CustomParamTransport("offsetX","event.getNativeEvent().offsetX"),
View Full Code Here

    protected void addPartValue(Element element, String name, Object value) {
        if (value instanceof Document) {
            Document doc = (Document) value;
            Element root = doc.getDocumentElement();
            doc.removeChild(root);
            element.appendChild(root);
        }
        else if (value != null) {
            String text = value.toString();
            element.appendChild(element.getOwnerDocument().createTextNode(text));
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.