Package org.w3c.dom

Examples of org.w3c.dom.Element.normalize()


        }
        if (docElement == null) {
            Debug.logWarning("Document element not found in " + this.readerURL, module);
            throw new DataFileException("Document element not found in " + this.readerURL);
        }
        docElement.normalize();
        List<? extends Element> dataFileElements = UtilXml.childElementList(docElement, "data-file");
        if (dataFileElements.size() == 0) {
            Debug.logWarning("No <data-file> elements found in " + this.readerURL, module);
            throw new DataFileException("No <data-file> elements found in " + this.readerURL);
        }
View Full Code Here


        try {
            ins = au.openStream();
            InputSource is =new InputSource(ins);
            Document doc = docBuilder.parse(is);
            Element root = doc.getDocumentElement();
            root.normalize();
            if (DEBUG) {
                logger.log(logger.INFO, "FileACL.loadAsXML("+au+"), root="+
                                         root.getNodeName());
            }
            if (!travelChildren(root, 0, au)) {
View Full Code Here

         DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         docBuilderFactory.setNamespaceAware(true);
         DocumentBuilder parser = docBuilderFactory.newDocumentBuilder();
         doc = parser.parse(xmlInp);
         Element root = doc.getDocumentElement();
         root.normalize();
         return root;
      }
      catch (SAXParseException err) {
         log.configuratorSAXParseError(err);
      }
View Full Code Here

           
            QName nn = new QName("http://gizmos.com/orders/", "order");
            Iterator<Element> it = CastUtils.cast(detail.getChildElements(nn));
            assertTrue(it.hasNext());
            Element el = it.next();
            el.normalize();
            assertEquals("Quantity element does not have a value", el.getFirstChild().getNodeValue());
            el = it.next();
            el.normalize();
            assertEquals("Incomplete address: no zip code", el.getFirstChild().getNodeValue());
        }       
View Full Code Here

            assertTrue(it.hasNext());
            Element el = it.next();
            el.normalize();
            assertEquals("Quantity element does not have a value", el.getFirstChild().getNodeValue());
            el = it.next();
            el.normalize();
            assertEquals("Incomplete address: no zip code", el.getFirstChild().getNodeValue());
        }       
    }
   
    /*-------------------------------------------------------
 
View Full Code Here

                    Element titlePeer =
                        getPeerWithTag(elt,
                                       SVGConstants.SVG_NAMESPACE_URI,
                                       SVGConstants.SVG_TITLE_TAG);
                    if (titlePeer != null) {
                        titlePeer.normalize();
                        toolTip = Messages.formatMessage(TOOLTIP_TITLE_AND_TEXT,
                                                         new Object[] {
                            toFormattedHTML(titlePeer.getFirstChild().getNodeValue()),
                                toFormattedHTML(toolTip)});
                    } else {
View Full Code Here

                    Element titlePeer =
                        getPeerWithTag(elt,
                                       SVGConstants.SVG_NAMESPACE_URI,
                                       SVGConstants.SVG_TITLE_TAG);
                    if (titlePeer != null) {
                        titlePeer.normalize();
                        toolTip = Messages.formatMessage(TOOLTIP_TITLE_AND_TEXT,
                                                         new Object[] {
                            toFormattedHTML(titlePeer.getFirstChild().getNodeValue()),
                                toFormattedHTML(toolTip)});
                    } else {
View Full Code Here

            Element enumeration = XUtil.getFirstChildElement(attribute, "enumeration");
            if (attrType.equals("NMTOKEN") && enumeration != null) {
                out.print('(');
                Element literal = XUtil.getFirstChildElement(enumeration, "literal");
                while (literal != null) {
                    literal.normalize();
                    Node literalValueNode = getFirstChildOfType(literal, Node.TEXT_NODE);
                    String literalValue = literalValueNode != null
                                        ? literalValueNode.getNodeValue() : "";
                    out.print(literalValue);
                    literal = XUtil.getNextSiblingElement(literal, "literal");
View Full Code Here

            return null;
        if (!"entity-engine-xml".equals(docElement.getTagName())) {
            Debug.logError("[GenericDelegator.makeValues] Root node was not <entity-engine-xml>", module);
            throw new java.lang.IllegalArgumentException("Root node was not <entity-engine-xml>");
        }
        docElement.normalize();
        Node curChild = docElement.getFirstChild();

        if (curChild != null) {
            do {
                if (curChild.getNodeType() == Node.ELEMENT_NODE) {
View Full Code Here

      is.setCharacterStream(new StringReader(responseContent));

      Document doc = db.parse(is);

      Element rootElement = (Element) doc.getDocumentElement();
      rootElement.normalize();


      return doc;
    }
    catch(SAXException e)
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.