Package org.dom4j

Examples of org.dom4j.Element.asXML()


    while (iter.hasNext()) {
      Element variableElement = (Element) iter.next();
     
      String variableName = variableElement.attributeValue("name");
      if (variableName==null) {
        addProblem(new Problem(Problem.LEVEL_WARNING, "the name attribute of a variable element is required: "+variableElement.asXML()));
      }
      String access = variableElement.attributeValue("access", "read,write");
      String mappedName = variableElement.attributeValue("mapped-name");
     
      variableAccesses.add(new VariableAccess(variableName, access, mappedName));
View Full Code Here


      Element actionElement = (Element) unresolvedActionReference[0];
      Action action = (Action) unresolvedActionReference[1];
      String referencedActionName = actionElement.attributeValue("ref-name");
      Action referencedAction = processDefinition.getAction(referencedActionName);
      if (referencedAction==null) {
        addWarning("couldn't resolve action reference in "+actionElement.asXML());
      }
      action.setReferencedAction(referencedAction);
    }
  }
View Full Code Here

      "</carPart><model>Model 1</model><carType id=\"" +
      carType.getId() +
      "\"><typeName>Type 1</typeName></carType></car>";
       
    print(element);
    assertTrue(element.asXML().equals(expectedResult));
   
    s.createQuery("delete from CarPart").executeUpdate();
    s.createQuery("delete from Car").executeUpdate();
    s.createQuery("delete from CarType").executeUpdate();
   
View Full Code Here

       
    for (int i = 0; i < list.size(); i++) {
      Element element = (Element) list.get(i);

      print(element);
      assertTrue(element.asXML().equals(expectedResults[i]));
    }
   
    s.createQuery("delete from Car").executeUpdate();
    s.createQuery("delete from CarType").executeUpdate();
   
View Full Code Here

    }
   
    public void testBug894878() {
        Element foo = DocumentFactory.getInstance().createElement("foo");
        foo.addText("bla").addAttribute("foo", "bar");
        assertEquals("<foo foo=\"bar\">bla</foo>", foo.asXML());

        foo = DocumentFactory.getInstance().createElement("foo");
        foo.addAttribute("foo", "bar").addText("bla");
        assertEquals("<foo foo=\"bar\">bla</foo>", foo.asXML());
    }
View Full Code Here

        foo.addText("bla").addAttribute("foo", "bar");
        assertEquals("<foo foo=\"bar\">bla</foo>", foo.asXML());

        foo = DocumentFactory.getInstance().createElement("foo");
        foo.addAttribute("foo", "bar").addText("bla");
        assertEquals("<foo foo=\"bar\">bla</foo>", foo.asXML());
    }

    public void testGetNamespacesForURI() throws Exception {
        String xml = "<schema targetNamespace='http://SharedTest.org/xsd' "
                + "        xmlns='http://www.w3.org/2001/XMLSchema' "
View Full Code Here

        if (null != lineNumber)
            copy.remove(lineNumber);
       
        copy.remove(copy.getNamespace());

        return copy.asXML();
    }

    static boolean skippable(Attribute type) {
        if (null == type)
            return false;
View Full Code Here

    while (iter.hasNext()) {
      Element variableElement = (Element) iter.next();
     
      String variableName = variableElement.attributeValue("name");
      if (variableName==null) {
        addProblem(new Problem(Problem.LEVEL_WARNING, "the name attribute of a variable element is required: "+variableElement.asXML()));
      }
      String access = variableElement.attributeValue("access", "read,write");
      String mappedName = variableElement.attributeValue("mapped-name");
     
      variableAccesses.add(new VariableAccess(variableName, access, mappedName));
View Full Code Here

      Element actionElement = (Element) unresolvedActionReference[0];
      Action action = (Action) unresolvedActionReference[1];
      String referencedActionName = actionElement.attributeValue("ref-name");
      Action referencedAction = processDefinition.getAction(referencedActionName);
      if (referencedAction==null) {
        addWarning("couldn't resolve action reference in "+actionElement.asXML());
      }
      action.setReferencedAction(referencedAction);
    }
  }
View Full Code Here

  public String getPropertyAsXml(String xpath) {
    if (document==null) return null;
    Element child = (Element) document.selectSingleNode(xpath);
    if (child == null)
      return null;
    return child.asXML();
  }

  public String getPropertyAsXml(String xpath, String defaultValue) {
    String value = getProperty(xpath);
    if (value==null || "".equals(value)) return defaultValue;
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.