Package org.exist.dom

Examples of org.exist.dom.NodeListImpl


                                       
                    //update the document
                    switch (node.getNodeType())
                    {
                        case Node.ELEMENT_NODE:
                final NodeListImpl content = new NodeListImpl();
                for (final SequenceIterator j = contentSeq.iterate(); j.hasNext(); ) {
                  final Item next = j.nextItem();
                  if (Type.subTypeOf(next.getType(), Type.NODE))
                    {content.add(((NodeValue)next).getNode());}
                  else {
                    text = new TextImpl(next.getStringValue());
                    content.add(text);
                  }
                }
                            ((ElementImpl) node).update(transaction, content);
                            break;
                        case Node.TEXT_NODE:
View Full Code Here


        return Sequence.EMPTY_SEQUENCE;
       
  }

  private NodeList seq2nodeList(Sequence contentSeq) throws XPathException {
        final NodeListImpl nl = new NodeListImpl();
        for (final SequenceIterator i = contentSeq.iterate(); i.hasNext(); ) {
            final Item item = i.nextItem();
            if (Type.subTypeOf(item.getType(), Type.NODE)) {
                final NodeValue val = (NodeValue) item;
                nl.add(val.getNode());
            }
        }
        return nl;
    }
View Full Code Here

  
   public static Element replaceTextElement(Txn txn,ElementImpl parent,String namespaceName,String localName,String value,boolean firstChild) {
      ElementImpl textE = (ElementImpl)DOM.findChild(parent,namespaceName,localName);
      if (textE==null) {
         textE = (ElementImpl)parent.getOwnerDocument().createElementNS(namespaceName,localName);
         final NodeListImpl nl = new NodeListImpl(1);
         nl.add(textE);
         if (firstChild) {
            parent.insertAfter(txn,nl,parent.getFirstChild());
         } else {
            parent.appendChildren(txn,nl,-1);
         }
View Full Code Here

      textE.appendChild(parent.getOwnerDocument().createTextNode(value));
      return textE;
   }
  
   public static void appendChild(Txn txn,ElementImpl parent,Node child) {
      final NodeListImpl nl = new NodeListImpl(1);
      nl.add(child);
      parent.appendChildren(txn,nl,-1);
   }
View Full Code Here

      nl.add(child);
      parent.appendChildren(txn,nl,-1);
   }
  
   public static Node insertBefore(Txn txn,ElementImpl parent,Node child,Node refChild) {
      final NodeListImpl nl = new NodeListImpl(1);
      nl.add(child);
      parent.insertBefore(txn,nl,refChild);
      return child;
   }
View Full Code Here

TOP

Related Classes of org.exist.dom.NodeListImpl

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.