Changeset 26354

Show
Ignore:
Timestamp:
18.10.2012 15:40:10 (7 years ago)
Author:
kjdon
Message:

new function

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/util/XMLTools.java

    r26105 r26354  
    170170    } 
    171171 
     172  /** duplicates all elements in list elements and appends to toElement */ 
     173  public static void duplicateElementList(Document owner, Element toElement, NodeList elements, boolean with_attributes) { 
     174    int num_elems = elements.getLength(); 
     175    if (num_elems < 1) 
     176      { 
     177    return; 
     178      } 
     179    for (int i = 0; i < num_elems; i++) 
     180      { 
     181    Element to_element = XMLTools.duplicateElement(owner, (Element) elements.item(i), with_attributes); 
     182    toElement.appendChild(to_element); 
     183      } 
     184 
     185  } 
    172186    /** Duplicates an element */ 
    173187    public static Element duplicateElement(Document owner, Element element, boolean with_attributes)