Example #1
0
 /** Expand a single entity. */
 public void expandEntity(ActiveEntity n, Output dst) {
   NodeList value = n.getValueNodes(this);
   if (value == null) {
     dst.putNode(n);
   } else {
     Copy.copyNodes(value, dst);
   }
 }
Example #2
0
 /** Expand an entity reference. */
 public void expandEntityRef(EntityReference n, Output dst) {
   String name = n.getNodeName();
   NodeList value = Index.getIndexValue(this, name);
   if (value == null) {
     dst.putNode(n);
   } else {
     Copy.copyNodes(value, dst);
   }
 }
Example #3
0
 public void expandNodes(ActiveNodeList nl, Output dst) {
   int len = nl.getLength();
   for (int i = 0; i < len; ++i) {
     ActiveNode n = nl.activeItem(i);
     if (n.getNodeType() == Node.ENTITY_NODE) {
       expandEntity((ActiveEntity) n, dst);
     } else if (n.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
       expandEntityRef((EntityReference) n, dst);
     } else {
       dst.putNode(n);
     }
   }
 }