Examples of OMProcessingInstruction


Examples of org.apache.axiom.om.OMProcessingInstruction

                factory.createOMText(dest, text.getText());
            } else if (node.getType() == OMNode.COMMENT_NODE) {
                OMComment comment = (OMComment)node;
                factory.createOMComment(dest, comment.getValue());
            } else if (node.getType() == OMNode.PI_NODE) {
                OMProcessingInstruction pi = (OMProcessingInstruction)node;
                factory.createOMProcessingInstruction(dest, pi.getTarget(), pi.getValue());
            } else if (node.getType() == OMNode.SPACE_NODE) {
                OMText text = (OMText)node;
                factory.createOMText(dest, text.getText(), OMNode.SPACE_NODE);
            } else if (node.getType() == OMNode.ENTITY_REFERENCE_NODE) {
                OMText text = (OMText)node;
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

                case OMNode.ELEMENT_NODE:
                    Element el = (Element)node;
                    omdoc.addChild((OMNode)el.clone());
                    break;
                case OMNode.PI_NODE:
                    OMProcessingInstruction pi = (OMProcessingInstruction)node;
                    factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
                    break;
            }
        }
        return doc;
    }
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

    public String[] getProcessingInstruction(String target) {
        List<String> values = new ArrayList<String>();
        for (Iterator i = getChildren(); i.hasNext();) {
            OMNode node = (OMNode)i.next();
            if (node.getType() == OMNode.PI_NODE) {
                OMProcessingInstruction pi = (OMProcessingInstruction)node;
                if (pi.getTarget().equalsIgnoreCase(target))
                    values.add(pi.getValue());
            }
        }
        return values.toArray(new String[values.size()]);
    }
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

        }
        return values.toArray(new String[values.size()]);
    }

    public Document<T> addProcessingInstruction(String target, String value) {
        OMProcessingInstruction pi = this.factory.createOMProcessingInstruction(null, target, value);
        if (this.getOMDocumentElement() != null) {
            this.getOMDocumentElement().insertSiblingBefore(pi);
        } else {
            this.addChild(pi);
        }
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

        case OMNode.ELEMENT_NODE:
          Element el = (Element) node;
          omdoc.addChild((OMNode) el.clone());
          break;
        case OMNode.PI_NODE:
          OMProcessingInstruction pi = (OMProcessingInstruction) node;
          factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
          break;
      }
    }
    return doc;
  }
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

  public String[] getProcessingInstruction(String target) {
    List<String> values = new ArrayList<String>();
    for (Iterator i = getChildren(); i.hasNext();) {
      OMNode node = (OMNode) i.next();
      if (node.getType() == OMNode.PI_NODE) {
        OMProcessingInstruction pi = (OMProcessingInstruction) node;
        if (pi.getTarget().equalsIgnoreCase(target))
          values.add(pi.getValue());
      }
    }
    return values.toArray(new String[values.size()]);
  }
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

    }
    return values.toArray(new String[values.size()]);
  }

  public Document<T> addProcessingInstruction(String target, String value) {
    OMProcessingInstruction pi =
      this.factory.createOMProcessingInstruction(
        null, target, value);
    if (this.getOMDocumentElement() != null) {
      this.getOMDocumentElement().insertSiblingBefore(pi);
    } else {
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

        factory.createOMText(dest,text.getText());
      } else if (node.getType() == OMNode.COMMENT_NODE) {
        OMComment comment = (OMComment) node;
        factory.createOMComment(dest, comment.getValue());
      } else if (node.getType() == OMNode.PI_NODE) {
        OMProcessingInstruction pi = (OMProcessingInstruction) node;
        factory.createOMProcessingInstruction(dest, pi.getTarget(), pi.getValue());
      } else if (node.getType() == OMNode.SPACE_NODE) {
        OMText text = (OMText) node;
        factory.createOMText(dest, text.getText(), OMNode.SPACE_NODE);
      } else if (node.getType() == OMNode.ENTITY_REFERENCE_NODE) {
        OMText text = (OMText) node;
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

    public TestCreateOMProcessingInstructionWithoutParent(OMMetaFactory metaFactory) {
        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMProcessingInstruction pi = metaFactory.getOMFactory().createOMProcessingInstruction(null, "mypi", "data");
        assertNull(pi.getParent());
        assertEquals("mypi", pi.getTarget());
        assertEquals("data", pi.getValue());
    }
View Full Code Here

Examples of org.apache.axiom.om.OMProcessingInstruction

        OMDocument document = OMXMLBuilderFactory.createOMBuilder(factory,
                new StringReader("<?pi data?><root>text</root>")).getDocument();
        if (complete) {
            document.build();
        }
        OMProcessingInstruction firstChild = (OMProcessingInstruction)document.getFirstOMChild();
        OMElement documentElement;
        if (accessDocumentElement) {
            documentElement = document.getOMDocumentElement();
            assertEquals(complete, documentElement.isComplete());
        } else {
            documentElement = null;
        }
        document.removeChildren();
        // Test that the child has been detached correctly.
        assertNull(firstChild.getParent());
        assertNull(firstChild.getPreviousOMSibling());
        assertNull(firstChild.getNextOMSibling());
        if (documentElement != null) {
            // Test that the child has been detached correctly.
            assertNull(documentElement.getParent());
            assertNull(documentElement.getPreviousOMSibling());
            assertNull(documentElement.getNextOMSibling());
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.