Package org.w3c.dom

Examples of org.w3c.dom.Document


  XmlReader(Loader loader) {
    this.loader = loader;
  }

  LogisimFile readLibrary(InputStream is) throws IOException, SAXException {
    Document doc = loadXmlFrom(is);
    Element elt = doc.getDocumentElement();
    considerRepairs(doc, elt);
    LogisimFile file = new LogisimFile((Loader) loader);
    ReadContext context = new ReadContext(file);
    context.toLogisimFile(elt);
    if (file.getCircuitCount() == 0) {
View Full Code Here


                userAgent.getImageSessionContext(),
                new AffineTransform());

        //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
        //to it.
        Document clonedDoc = BatikUtil.cloneSVGDocument(doc);

        GraphicsNode root;
        try {
            GVTBuilder builder = new GVTBuilder();
            root = builder.build(ctx, clonedDoc);
View Full Code Here

   public static List<SkinConfigTask> fetchTasks(DocumentSource source)
   {
      try
      {
         Document document = VALIDATOR.validate(source);
        
         List<SkinConfigTask> tasks = new ArrayList<SkinConfigTask>();
         Element docElement = document.getDocumentElement();

         fetchTasksByTagName(GateinResource.PORTAl_SKIN_TAG, docElement, tasks);
         fetchTasksByTagName(GateinResource.PORTLET_SKIN_TAG, docElement, tasks);
         fetchTasksByTagName(GateinResource.WINDOW_STYLE_TAG, docElement, tasks);
View Full Code Here

  public void testExclusiveSplitXPathAdvanced() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-ExclusiveSplitXPath-advanced.bpmn2");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler());
        Map<String, Object> params = new HashMap<String, Object>();
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        Element hi = doc.createElement("hi");
        Element ho = doc.createElement("ho");
        hi.appendChild(ho);
        Attr attr = doc.createAttribute("value");
        ho.setAttributeNode(attr);
        attr.setValue("a");
        params.put("x", hi);
        params.put("y", "Second");
        ProcessInstance processInstance = ksession.startProcess("com.sample.test", params);
View Full Code Here

  public void testExclusiveSplitXPathAdvanced2() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-ExclusiveSplitXPath-advanced-vars-not-signaled.bpmn2");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler());
        Map<String, Object> params = new HashMap<String, Object>();
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        Element hi = doc.createElement("hi");
        Element ho = doc.createElement("ho");
        hi.appendChild(ho);
        Attr attr = doc.createAttribute("value");
        ho.setAttributeNode(attr);
        attr.setValue("a");
        params.put("x", hi);
        params.put("y", "Second");
        ProcessInstance processInstance = ksession.startProcess("com.sample.test", params);
View Full Code Here

  public void testExclusiveSplitXPathAdvancedWithVars() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-ExclusiveSplitXPath-advanced-with-vars.bpmn2");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler());
        Map<String, Object> params = new HashMap<String, Object>();
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        Element hi = doc.createElement("hi");
        Element ho = doc.createElement("ho");
        hi.appendChild(ho);
        Attr attr = doc.createAttribute("value");
        ho.setAttributeNode(attr);
        attr.setValue("a");
        params.put("x", hi);
        params.put("y", "Second");
        ProcessInstance processInstance = ksession.startProcess("com.sample.test", params);
View Full Code Here

    }

  public void testXpathExpression() throws Exception {
    KnowledgeBase kbase = createKnowledgeBase("BPMN2-XpathExpression.bpmn2");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
    Document document = DocumentBuilderFactory.newInstance()
      .newDocumentBuilder().parse(new ByteArrayInputStream(
        "<instanceMetadata><user approved=\"false\" /></instanceMetadata>".getBytes()));
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("instanceMetadata", document);
    ProcessInstance processInstance = ksession.startProcess("XPathProcess", params);
View Full Code Here

  }
 
  public void testXORGateway() throws Exception {
      KnowledgeBase kbase = createKnowledgeBase("BPMN2-gatewayTest.bpmn2");
      StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
      Document document = DocumentBuilderFactory.newInstance()
      .newDocumentBuilder().parse(new ByteArrayInputStream(
              "<instanceMetadata><user approved=\"false\" /></instanceMetadata>".getBytes()));
      Map<String, Object> params = new HashMap<String, Object>();
      params.put("instanceMetadata", document);
      params.put("startMessage", DocumentBuilderFactory.newInstance()
View Full Code Here

            }
            public void executeWorkItem(WorkItem workItem, WorkItemManager mgr) {
                assertEquals("hello world", workItem.getParameter("coId"));
            }           
        });
        Document document = DocumentBuilderFactory.newInstance()
        .newDocumentBuilder().parse(new ByteArrayInputStream(
                "<user hello='hello world' />".getBytes()));
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("instanceMetadata", document.getFirstChild());
        ProcessInstance processInstance = ksession.startProcess("process", params);
    }
View Full Code Here

                assertEquals("user", ((Element) workItem.getParameter("coId")).getFirstChild().getFirstChild().getNodeName());
                assertEquals("hello world", ((Element) workItem.getParameter("coId")).getFirstChild().getFirstChild().getAttributes().getNamedItem("hello").getNodeValue());
            }
           
        });
        Document document = DocumentBuilderFactory.newInstance()
        .newDocumentBuilder().parse(new ByteArrayInputStream(
                "<user hello='hello world' />".getBytes()));
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("instanceMetadata", document.getFirstChild());
        ProcessInstance processInstance = ksession.startProcess("process", params);
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.Document

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.