Package org.w3c.dom

Examples of org.w3c.dom.Node


    if (!version.equals("1.0")) {
      throw new GUIException("Invalid XML description file version [" + version + "]");
    }

    for (int i = 0; i < widgets.getLength(); i++) {
      Node node = widgets.item(i);
      if (node.getNodeType() == Node.ELEMENT_NODE
        && node.getNodeName().equals("widget")
        && ((Element) node).getAttribute("name").equals(widgetName))
        return constructWidget(document, (Element) node, listener, dataModel, parentWidget);
    }
    throw new GUIException("Widget [" + widgetName + "] could not be found");
  }
View Full Code Here


                        Element eReference = (Element) elReferences.item(j);
                        DcObject reference = referenceMod.getItem();
                        String referenceField = Converter.getValidXmlTag(reference.getField(reference.getSystemDisplayFieldIdx()).getSystemName());
                        NodeList nlRefField = eReference.getElementsByTagName(referenceField);
                        if (nlRefField != null && nlRefField.getLength() > 0) {
                            Node eRefField = nlRefField.item(0);
                            setValue(dco, field.getIndex(), eRefField.getTextContent(), listener);
                        } else {
                            logger.debug("Could not set value for field " + referenceField + ". The field name does not exist in the XML file");
                        }
                    }
                } else if (field.getValueType() == DcRepository.ValueTypes._DCOBJECTREFERENCE) {
View Full Code Here

     * @exception IOException on error reading input
     */
   
    protected void unmarshalContent(Node parent)
        throws JiBXException, IOException {
        Node node;
        while ((node = unmarshalNode()) != null) {
            parent.appendChild(node);
        }
    }
View Full Code Here

    final NodeList nl = e.getChildNodes();
    final StringBuffer result = new StringBuffer(100);

    for (int i = 0; i < nl.getLength(); i++)
    {
      final Node n = nl.item(i);
      if (n.getNodeType() == Node.TEXT_NODE)
      {
        final Text text = (Text) n;

        result.append(text.getData());
      }
      else if (n.getNodeType() == Node.ENTITY_REFERENCE_NODE)
      {
        result.append('&');
        result.append(n.getNodeName());
        result.append(';');
      }
    }
    return XML_ENTITIES.decodeEntities(result.toString());
  }
View Full Code Here

            List nodes = m_formatCache.getFormatter(custom).getClassDocumentation(info);
            if (nodes != null) {
                AnnotationElement anno = new AnnotationElement();
                DocumentationElement doc = new DocumentationElement();
                for (Iterator iter = nodes.iterator(); iter.hasNext();) {
                    Node node = (Node)iter.next();
                    doc.addContent(node);
                }
                anno.getItemsList().add(doc);
                root.setAnnotation(anno);
            }
View Full Code Here

            List nodes = m_formatCache.getFormatter(custom).getItemDocumentation(item);
            if (nodes != null) {
                AnnotationElement anno = new AnnotationElement();
                DocumentationElement doc = new DocumentationElement();
                for (Iterator iter = nodes.iterator(); iter.hasNext();) {
                    Node node = (Node)iter.next();
                    doc.addContent(node);
                }
                anno.getItemsList().add(doc);
                elem.setAnnotation(anno);
            }
View Full Code Here

    NodeList nodeList = _node.getChildNodes();
    if (nodeList != null) {
      int length = nodeList.getLength();
      ArrayList vector = null;
      for(int i=0; i<length; i++) {
        Node child = nodeList.item(i);
        if (child.getNodeType() == Node.ELEMENT_NODE) {
          if (((Element)child).getTagName().equalsIgnoreCase(attribute)) {
            if (vector == null) {
              vector = new ArrayList();
            }
            vector.add(new AnyNode(child));
View Full Code Here

  public Any getReference(Context context, Any index)
  {
    if (index.isInt()) {
      NodeList nodeList = _node.getChildNodes();
      if (nodeList != null) {
        Node child = nodeList.item(index.toInt());
        if (child != null) {
          return new AnyNode(child);
        }
      }
    } else {
View Full Code Here

  /// @synopsis Node getOwnerDocument()
  /// @return the document where this node belongs to,
  ///    returns <code>null</code> is this node is already document node.
  public Any m_getOwnerDocument()
  {
    Node document = _node.getOwnerDocument();
    return (document != null) ? new AnyNode(document) : NULL;
  }
View Full Code Here

  /// @synopsis Node getParentNode()
  /// @return the parent node of this node, returns <code>null</code>
  ///    if this node does not have a parent.
  public Any m_getParentNode()
  {
    Node parent = _node.getParentNode();
    return (parent != null) ? new AnyNode(parent) : NULL;
  }
View Full Code Here

TOP

Related Classes of org.w3c.dom.Node

Copyright © 2018 www.massapicom. 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.