Package nu.xom

Examples of nu.xom.ProcessingInstruction


    }

   
    public void testNFCInProcessingInstruction() throws IOException {
       
        doc.appendChild(new ProcessingInstruction("c\u0327hat", "c\u0327hat"));
        Serializer serializer = new Serializer(out);
        serializer.setUnicodeNormalizationFormC(true);
        serializer.write(doc);
        serializer.flush();
        out.close();
View Full Code Here


      String str = elem.getValue();
      response.sendError(code, str);
    } else {
        String serverRoot = Oscar3Props.getInstance().serverRoot;
        if(serverRoot == null || serverRoot.equals("none")) serverRoot = "";
      ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"" + serverRoot + "/sciborg.xsl\"");
      responseDoc.insertChild(pi, 0);
      response.setContentType("application/xml");
      new Serializer(response.getOutputStream()).write(responseDoc);     
    }
  }
View Full Code Here

                        attr.addAttribute(new Attribute("name", a.getLocalName()));
                        attr.appendChild(a.getValue());
                        attrEd.appendChild(attr);
                }

                ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet",
                                "type=\"text/xsl\" href=\"ARTtoHTMLJS.xsl\"");
                editorDoc.insertChild(pi, 0);
                pi = new ProcessingInstruction("host",
                                Oscar3Props.getInstance().hostname + ":8181");
                editorDoc.insertChild(pi, 0);

                return editorDoc;
        }
View Full Code Here

 
  public void removeProcessingInstructions() {
    procInstructions = new ArrayList<ProcessingInstruction>();
    Nodes piNodes = pubXMLDoc.getRootElement().query(".//processing-instruction()");
    for(int i=0;i<piNodes.size();i++) {
      ProcessingInstruction pi = (ProcessingInstruction)piNodes.get(i);
      ParentNode piParent = pi.getParent();
      int index = piParent.indexOf(pi);
      Element e = new Element("pi-proxy");
      e.addAttribute(new Attribute("pinumber", Integer.toString(i)));
      pi.detach();
      piParent.insertChild(e, index);
      procInstructions.add(pi);
    }   
  }
View Full Code Here

    for(int i=0;i<proxyNodes.size();i++) {
      Element e = (Element)proxyNodes.get(i);
      ParentNode eParent = e.getParent();
      int index = eParent.indexOf(e);
      int pin = Integer.parseInt(e.getAttributeValue("pinumber"));
      ProcessingInstruction pi = procInstructions.get(pin);
      e.detach();
      eParent.insertChild(pi, index);
    }       
  }
View Full Code Here

  }
 
  //change to addMode1PI for both kinds of server, see below
  public void addServerProcessingInstructions() {
    removeProcessingInstructions();
    ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/toHTMLJS.xsl\"");
    insertChild(pi, 0);
    pi = new ProcessingInstruction("jarpath", "/");
    insertChild(pi, 1);
    pi = new ProcessingInstruction("host", Oscar3Props.getInstance().hostname + ":8181");
    insertChild(pi, 2);
    pi = new ProcessingInstruction("viewer", "picture");
    insertChild(pi, 3);
  }
View Full Code Here

    insertChild(pi, 3);
  }
 
  public void addMode2OSCARPI() {
    removeProcessingInstructions();
    ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/art_tool_web/xsl/mode2.xsl\""); //works for oscar version
    //ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/xsl/mode2.xsl\"");
    insertChild(pi, 0);
    pi = new ProcessingInstruction("jarpath", "/");
    insertChild(pi, 1);
    pi = new ProcessingInstruction("host", Oscar3Props.getInstance().hostname + ":8181");
    insertChild(pi, 2);
  }
View Full Code Here

  }
 
  public void addMode2SapientPI() {
    removeProcessingInstructions();
    //ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/art_tool_web/xsl/mode2.xsl\""); //works for oscar version
    ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/xsl/mode2.xsl\"");
    insertChild(pi, 0);
    pi = new ProcessingInstruction("jarpath", "/");
    insertChild(pi, 1);
    pi = new ProcessingInstruction("host", Oscar3Props.getInstance().hostname + ":8181");
    insertChild(pi, 2);
  }
View Full Code Here

  public void addServerProcessingInstructions() {
    removeProcessingInstructions();
      String serverRoot = Oscar3Props.getInstance().serverRoot;
      if(serverRoot == null || serverRoot.equals("none")) serverRoot = "";
   
    ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"" + serverRoot + "/toHTMLJS.xsl\"");
    insertChild(pi, 0);
    pi = new ProcessingInstruction("jarpath", "/");
    insertChild(pi, 1);
    pi = new ProcessingInstruction("host", Oscar3Props.getInstance().hostname + ":" + Oscar3Props.getInstance().port);
    insertChild(pi, 2);
    pi = new ProcessingInstruction("path", serverRoot);
    insertChild(pi, 3);
    pi = new ProcessingInstruction("viewer", "picture");
    insertChild(pi, 4);
    if(Oscar3Props.getInstance().polymerMode) {
      pi = new ProcessingInstruction("polymermode", "true");
      insertChild(pi, 5);     
    }
  }
View Full Code Here

        return new Comment(comment.getValue());
    }

   
    private Node copy(ProcessingInstruction pi) {
        return new ProcessingInstruction(pi.getTarget(), pi.getValue());
    }
View Full Code Here

TOP

Related Classes of nu.xom.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.