Package org.w3c.dom

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


    }
    catch (Exception e) {
      throw new RuntimeException(e);
    }

    document.normalizeDocument();
    at.getAny().add(document.getDocumentElement());

    document = builder.newDocument();
    Element el = document.createElement("myelement");
    el.setTextContent("howdy");
View Full Code Here


      // normalize the document to remove unused namespaces.
      DOMConfiguration docConfig = document.getDomConfig();
      docConfig.setParameter("namespaces", Boolean.TRUE);
      docConfig.setParameter("namespace-declarations", Boolean.FALSE);
      document.normalizeDocument();
     
      return document.getDocumentElement();
   }

   /**
 
View Full Code Here

    Element rootItem = d.createElement(SERVICE_LIST_NODE_NAME);  
    d.appendChild(rootItem);  
    ServicePublisher publisher = new XmlResourcePublisher(rootItem, d);
       publishAllServcies(publisher);
        d.normalizeDocument();  
       
        // Returns the XML representation of this document.  
        return representation;  
  }
 
View Full Code Here

      // normalize the document to remove unused namespaces.
      DOMConfiguration docConfig = document.getDomConfig();
      docConfig.setParameter("namespaces", Boolean.TRUE);
      docConfig.setParameter("namespace-declarations", Boolean.FALSE);
      document.normalizeDocument();
     
      return document.getDocumentElement();
   }

   /**
 
View Full Code Here

                root.appendChild(core.createElementNS("UndefinedNamespace", "NS1:foo"));
                config = core.getDomConfig();
                config.setParameter("error-handler",errorHandler);
                config.setParameter("validate", Boolean.TRUE);
                config.setParameter("schema-type", "http://www.w3.org/2001/XMLSchema");
                core.normalizeDocument();
                Assertion.verify(errorCounter == 3, "3 errors should be reported");
       
                errorCounter = 0;
                config.setParameter("validate", Boolean.FALSE);
                config.setParameter("comments", Boolean.FALSE);
View Full Code Here

                Assertion.verify(errorCounter == 3, "3 errors should be reported");
       
                errorCounter = 0;
                config.setParameter("validate", Boolean.FALSE);
                config.setParameter("comments", Boolean.FALSE);
                core.normalizeDocument();
                Assertion.verify(errorCounter == 0, "No errors should be reported");


                config = builder.getDomConfig();
                config.setParameter("validate", Boolean.FALSE);
View Full Code Here

                errorCounter = 0;
                config.setParameter("psvi", Boolean.TRUE);
                config.setParameter("error-handler",errorHandler);
                config.setParameter("validate", Boolean.TRUE);
                config.setParameter("schema-type", "http://www.w3.org/2001/XMLSchema");
                core.normalizeDocument();
                Assertion.verify(errorCounter == 0, "No errors should be reported");
                Assertion.verify(((ElementPSVI)e1).getElementDeclaration().getName().equals("person"), "e1 decl");             
               
                config = builder.getDomConfig();
                config.setParameter("validate", Boolean.FALSE);
View Full Code Here

                child4.setAttributeNS("http://a1", "xsl:attr1", "");
                child4.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "default");
                child3.appendChild(child4);
                root.appendChild(child3);

                doc.normalizeDocument();
               
                //
                // assertions
                //
View Full Code Here

                config.setParameter("error-handler",errorHandler);
                config.setParameter("schema-type", "http://www.w3.org/2001/XMLSchema");
                config.setParameter("schema-location","personal.xsd");
                config.setParameter("resource-resolver",resolver);
                config.setParameter("validate", Boolean.TRUE);
                core2.normalizeDocument();
                Assertion.verify(errorCounter == 1, "1 error should be reported: "+errorCounter);
   
            }
           
View Full Code Here

           
            // remove comments from the document
            config.setParameter("comments", Boolean.FALSE);

            System.out.println("Normalizing document... ");
            doc.normalizeDocument();


            // create DOMWriter
            LSSerializer domWriter = impl.createLSSerializer();
           
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.