Examples of NodeList


Examples of org.w3c.dom.NodeList

    public StylesheetInfo[] getStylesheets(org.w3c.dom.Document doc) {
        List list = new ArrayList();
        //get the processing-instructions (actually for XmlDocuments)
        //type and href are required to be set
        NodeList nl = doc.getChildNodes();
        for (int i = 0, len = nl.getLength(); i < len; i++) {
            Node node = nl.item(i);
            if (node.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE) continue;
            ProcessingInstruction piNode = (ProcessingInstruction) node;
            if (!piNode.getTarget().equals("xml-stylesheet")) continue;
            StylesheetInfo info = new StylesheetInfo();
            info = new StylesheetInfo();
View Full Code Here

Examples of org.w3c.dom.NodeList

  @Override
  public List<Element> elements(Element e, String name) {
    List<Element> eList = new ArrayList<Element>();

    NodeList nodeList = e.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); ++i) {
      Node node = nodeList.item(i);
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        if (name != null) {
          if (node.getNodeName().equals(name))
            eList.add((Element) node);
        } else {
View Full Code Here

Examples of org.w3c.dom.NodeList

    return eList;
  }

  @Override
  public Element element(Element e, String name) {
    NodeList element = e.getElementsByTagName(name);
    if (element != null && e.getNodeType() == Node.ELEMENT_NODE) {
      return (Element) element.item(0);
    }
    return null;
  }
View Full Code Here

Examples of org.w3c.dom.NodeList

  @Override
  public String getTextValue(Element valueEle) {
    if (valueEle != null) {
      StringBuilder sb = new StringBuilder();
      NodeList nl = valueEle.getChildNodes();
      for (int i = 0; i < nl.getLength(); i++) {
        Node item = nl.item(i);
        if ((item instanceof CharacterData && !(item instanceof Comment))
            || item instanceof EntityReference) {
          sb.append(item.getNodeValue());
        }
      }
View Full Code Here

Examples of y.base.NodeList

     * @param parentNode The parent node
     *
     * @return List of descendant nodes (parent node is included)
     */
    public NodeList getVisibleDescendants(Node parentNode) {
        NodeList visibleDescendants = new NodeList();
        NodeList allDescendants = getDescendants(parentNode);
        for (NodeCursor nc = getHierarchyManager().getInnerGraph(parentNode).nodes(); nc.ok(); nc.next()) {
            if (allDescendants.contains(nc.node())) {
                visibleDescendants.add(nc.node());
            }
        }

        return visibleDescendants;
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.