Package org.dom4j

Examples of org.dom4j.ProcessingInstruction


                    result.add(attr);
                }
            }
        }
        else if (node instanceof ProcessingInstruction) {
            ProcessingInstruction pi = (ProcessingInstruction)node;
            if ("target".equals(localName)) {
                result.add(new DefaultAttribute("target", pi.getTarget()));
            }
            else if ("data".equals(localName)) {
                result.add(new DefaultAttribute("data", pi.getText()));
            }
            else {
                result.add(new DefaultAttribute(localName, pi.getValue(localName)));
            }
        } else if (node instanceof DocumentType) {
            DocumentType doctype = (DocumentType)node;
            if ("publicId".equals(localName)) {
                result.add(new DefaultAttribute("publicId", doctype.getPublicID()));
View Full Code Here


        protected void runTest() throws Exception {
            jct.createContext().compileScript(jelly);
            Document dom = new SAXReader().read(jelly);
            checkLabelFor(dom);
            if (requirePI) {
                ProcessingInstruction pi = dom.processingInstruction("jelly");
                if (pi==null || !pi.getText().contains("escape-by-default"))
                    throw new AssertionError("<?jelly escape-by-default='true'?> is missing");

            }
            // TODO: what else can we check statically? use of taglibs?
        }
View Full Code Here

        }
    }

    public String getProcessingInstructionTarget(Object obj)
    {
        ProcessingInstruction pi = (ProcessingInstruction) obj;

        return pi.getTarget();
    }
View Full Code Here

        return pi.getTarget();
    }

    public String getProcessingInstructionData(Object obj)
    {
        ProcessingInstruction pi = (ProcessingInstruction) obj;

        return pi.getText();
    }
View Full Code Here

    if (node instanceof Text) {
      Text t = (Text)node;
      return t.getText();
    }
    if (node instanceof ProcessingInstruction) {
      ProcessingInstruction pi = (ProcessingInstruction)node;
      StringBuffer buf = new StringBuffer("<?");
      buf.append(pi.getName());
      buf.append(' ');
      buf.append(pi.getText());
      buf.append("?>");
      return buf.toString();
    }
    if (node instanceof Document) {
      return "XFA Document";
View Full Code Here

                    result.add(attr);
                }
            }
        }
        else if (node instanceof ProcessingInstruction) {
            ProcessingInstruction pi = (ProcessingInstruction)node;
            if ("target".equals(localName)) {
                result.add(new DefaultAttribute("target", pi.getTarget()));
            }
            else if ("data".equals(localName)) {
                result.add(new DefaultAttribute("data", pi.getText()));
            }
            else {
                result.add(new DefaultAttribute(localName, pi.getValue(localName)));
            }
        } else if (node instanceof DocumentType) {
            DocumentType doctype = (DocumentType)node;
            if ("publicId".equals(localName)) {
                result.add(new DefaultAttribute("publicId", doctype.getPublicID()));
View Full Code Here

    if (node instanceof Text) {
      Text t = (Text)node;
      return t.getText();
    }
    if (node instanceof ProcessingInstruction) {
      ProcessingInstruction pi = (ProcessingInstruction)node;
      StringBuffer buf = new StringBuffer("<?");
      buf.append(pi.getName());
      buf.append(' ');
      buf.append(pi.getText());
      buf.append("?>");
      return buf.toString();
    }
    if (node instanceof Document) {
      return "XFA Document";
View Full Code Here

        }
    }

    public String getProcessingInstructionTarget(Object obj)
    {
        ProcessingInstruction pi = (ProcessingInstruction) obj;

        return pi.getTarget();
    }
View Full Code Here

        return pi.getTarget();
    }

    public String getProcessingInstructionData(Object obj)
    {
        ProcessingInstruction pi = (ProcessingInstruction) obj;

        return pi.getText();
    }
View Full Code Here

        return textContent.toString();
    }

    public void setProcessingInstructions(List listOfPIs) {
        for (Iterator iter = listOfPIs.iterator(); iter.hasNext();) {
            ProcessingInstruction pi = (ProcessingInstruction) iter.next();
            addNode(pi);
        }
    }
View Full Code Here

TOP

Related Classes of org.dom4j.ProcessingInstruction

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.