Example usage for org.dom4j DocumentHelper createProcessingInstruction

List of usage examples for org.dom4j DocumentHelper createProcessingInstruction

Introduction

In this page you can find the example usage for org.dom4j DocumentHelper createProcessingInstruction.

Prototype

public static ProcessingInstruction createProcessingInstruction(String pi, Map<String, String> data) 

Source Link

Usage

From source file:bio.pih.genoogle.io.Output.java

public static Element genoogleXmlHeader() {
    DocumentFactory factory = DocumentFactory.getInstance();

    Document doc = factory.createDocument();
    doc.setName("genoogle");

    Map<String, String> xslProcessing = Maps.newHashMap();
    xslProcessing.put("type", "text/xsl");
    xslProcessing.put("href", "results.xsl");
    ProcessingInstruction xsltInstruction = DocumentHelper.createProcessingInstruction("xml-stylesheet",
            xslProcessing);/*from   w w w  .java  2s  .  co m*/
    doc.add(xsltInstruction);

    Element output = doc.addElement("genoogle");
    output.addElement("references").addAttribute("program", Genoogle.SOFTWARE_NAME)
            .addAttribute("version", Double.toString(Genoogle.VERSION))
            .addAttribute("copyright", Genoogle.COPYRIGHT);
    return output;
}

From source file:com.liferay.portal.xml.SAXReaderImpl.java

License:Open Source License

public ProcessingInstruction createProcessingInstruction(String target, Map<String, String> data) {

    org.dom4j.ProcessingInstruction processingInstruction = DocumentHelper.createProcessingInstruction(target,
            data);//  w w  w . ja  v  a 2 s . c om

    if (processingInstruction == null) {
        return null;
    } else {
        return new ProcessingInstructionImpl(processingInstruction);
    }
}

From source file:com.liferay.portal.xml.SAXReaderImpl.java

License:Open Source License

public ProcessingInstruction createProcessingInstruction(String target, String data) {

    org.dom4j.ProcessingInstruction processingInstruction = DocumentHelper.createProcessingInstruction(target,
            data);//ww w .  j  av  a  2  s  .  c o  m

    if (processingInstruction == null) {
        return null;
    } else {
        return new ProcessingInstructionImpl(processingInstruction);
    }
}