Package org.w3c.dom

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


            Document document;
            List<NutResource> list = Scans.me().loadResource(getScanPatten(), fileNames);
            for (NutResource nr : list) {
                InputStream ins = nr.getInputStream();
                document = builder.parse(ins);
                document.normalizeDocument();
                NodeList nodeListZ = ((Element) document.getDocumentElement()).getChildNodes();
                for (int i = 0; i < nodeListZ.getLength(); i++) {
                    if (nodeListZ.item(i) instanceof Element)
                        paserBean((Element) nodeListZ.item(i), false);
                }
View Full Code Here


        Document document;
        List<AopConfigrationItem> aopList = new ArrayList<AopConfigrationItem>();
        List<NutResource> list = Scans.me().loadResource(null, fileNames);
        for (NutResource nutResource : list) {
            document = builder.parse(nutResource.getInputStream());
            document.normalizeDocument();
            NodeList nodeListZ = ((Element) document.getDocumentElement()).getElementsByTagName("class");
            for (int i = 0; i < nodeListZ.getLength(); i++)
                aopList.add(parse((Element) nodeListZ.item(i)));
        }
        setAopItemList(aopList);
View Full Code Here

        }
        catch ( IOException e ) {
            System.out.printf( "Error: an error occoured during the parsing of %s: %s\n", filename, e.getMessage() );
            return dom_builder.newDocument().getDocumentElement();
        }
        document.normalizeDocument();
        return document.getDocumentElement();
    }
   
    public void mergeXMLs( String input_file_name_1, String input_file_name_2, String output_file_name ) {
        //merge the 2 documents together inplace
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

      String xmlResp = buffer.toString();
      this.rawResponse = xmlResp;

      Document doc = builder.parse( new ByteArrayInputStream( xmlResp.getBytes( "UTF-8" ) ) );
      doc.normalizeDocument();
      stripEmptyTextNodes( doc );

      printDom( doc, method.methodName() + "| " ); // TEST
      NodeList errors = doc.getElementsByTagName( ERROR_TAG );
      if ( errors.getLength() > 0 ) {
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

        if (type != MicrosoftTypes.String) {
            element.setAttributeNS("http://schemas.microsoft.com/ado/2007/08/dataservices/metadata", "type", type.toString());
        }
        element.setTextContent(value);
        document.appendChild(element);
        document.normalizeDocument();
        return document.getDocumentElement();
    }

    /**
     * Создает документ XMl для дальнейшего использования в преобразовании
View Full Code Here

      String xmlResp = buffer.toString();
      this.rawResponse = xmlResp;

      Document doc = builder.parse( new ByteArrayInputStream( xmlResp.getBytes( "UTF-8" ) ) );
      doc.normalizeDocument();
      stripEmptyTextNodes( doc );

      printDom( doc, method.methodName() + "| " ); // TEST
      NodeList errors = doc.getElementsByTagName( ERROR_TAG );
      if ( errors.getLength() > 0 ) {
View Full Code Here

    try {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware( namespaceAware );
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse( data );
      doc.normalizeDocument();
      stripEmptyTextNodes( doc );
      printDom( doc, method.methodName() + "| " );
      NodeList errors = doc.getElementsByTagName( ERROR_TAG );
      if ( errors.getLength() > 0 ) {
        int errorCode = Integer.parseInt( errors.item( 0 ).getFirstChild().getFirstChild().getTextContent() );
View Full Code Here

      e2.getDomConfig().setParameter(CDOMConfiguration.CANONICAL_FORM,
          Boolean.TRUE);
      e1.normalize();
      e2.normalize();
      e1.normalizeDocument();
      e2.normalizeDocument();
      return e1.toString().trim().equals(e2.toString().trim());
    }
    if (getNodeType() == ATTRIBUTE_NODE
        && arg.getNodeType() == ATTRIBUTE_NODE) {
      Attr e1 = (Attr) this;
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.