Package org.dom4j

Examples of org.dom4j.Element.attribute()


      }
     
      //add test time to total time
      long time = Long.parseLong(root.attributeValue(TIME_ATTRIBUTE));
      suite.addTime(time);
      root.attribute(TIME_ATTRIBUTE).setText(formatTime(time));

      //If the test method name is null, then make it the classname
      if(root.attributeValue(NAME_ATTRIBUTE).equals("null"))
      {
         root.attribute(NAME_ATTRIBUTE).setText(root.attributeValue(CLASSNAME_ATTRIBUTE));
View Full Code Here


      root.attribute(TIME_ATTRIBUTE).setText(formatTime(time));

      //If the test method name is null, then make it the classname
      if(root.attributeValue(NAME_ATTRIBUTE).equals("null"))
      {
         root.attribute(NAME_ATTRIBUTE).setText(root.attributeValue(CLASSNAME_ATTRIBUTE));
      }
     
      // Add the test to the report document
      document.getRootElement().add(root);
View Full Code Here

      // Check for special status adjustments to make to suite
      checkForStatus(test);
     
      //remove status attribute since it's only used by the report
      root.remove(root.attribute(STATUS_ATTRIBUTE));
   }
  
   private String formatTime(long time)
   {
      return String.format("%.3f", new Double(time / 1000.0000));
View Full Code Here

      for (Iterator i = root
          .elementIterator(PackageRelationship.RELATIONSHIP_TAG_NAME); i
          .hasNext();) {
        Element element = (Element) i.next();
        // Relationship ID
        String id = element.attribute(
            PackageRelationship.ID_ATTRIBUTE_NAME).getValue();
        // Relationship type
        String type = element.attribute(
            PackageRelationship.TYPE_ATTRIBUTE_NAME).getValue();
View Full Code Here

        Element element = (Element) i.next();
        // Relationship ID
        String id = element.attribute(
            PackageRelationship.ID_ATTRIBUTE_NAME).getValue();
        // Relationship type
        String type = element.attribute(
            PackageRelationship.TYPE_ATTRIBUTE_NAME).getValue();

        /* Check OPC Compliance */
        // Check Rule M4.1
        if (type.equals(PackageRelationshipTypes.CORE_PROPERTIES))
View Full Code Here

                "OPC Compliance error [M4.1]: there is more than one core properties relationship in the package !");

        /* End OPC Compliance */

        // TargetMode (default value "Internal")
        Attribute targetModeAttr = element
            .attribute(PackageRelationship.TARGET_MODE_ATTRIBUTE_NAME);
        TargetMode targetMode = TargetMode.INTERNAL;
        if (targetModeAttr != null) {
          targetMode = targetModeAttr.getValue().toLowerCase()
              .equals("internal") ? TargetMode.INTERNAL
View Full Code Here

        // Target converted in URI
        URI target;
        String value = "";
        try {
          value = element.attribute(
              PackageRelationship.TARGET_ATTRIBUTE_NAME)
              .getValue();

          if (value.indexOf("\\") != -1) {
            logger
View Full Code Here

      List defaultTypes = xmlContentTypetDoc.getRootElement().elements(
          DEFAULT_TAG_NAME);
      Iterator elementIteratorDefault = defaultTypes.iterator();
      while (elementIteratorDefault.hasNext()) {
        Element element = (Element) elementIteratorDefault.next();
        String extension = element.attribute(EXTENSION_ATTRIBUTE_NAME)
            .getValue();
        String contentType = element.attribute(
            CONTENT_TYPE_ATTRIBUTE_NAME).getValue();
        addDefaultContentType(extension, contentType);
      }
View Full Code Here

      Iterator elementIteratorDefault = defaultTypes.iterator();
      while (elementIteratorDefault.hasNext()) {
        Element element = (Element) elementIteratorDefault.next();
        String extension = element.attribute(EXTENSION_ATTRIBUTE_NAME)
            .getValue();
        String contentType = element.attribute(
            CONTENT_TYPE_ATTRIBUTE_NAME).getValue();
        addDefaultContentType(extension, contentType);
      }

      // Overriden content types
View Full Code Here

      List overrideTypes = xmlContentTypetDoc.getRootElement().elements(
          OVERRIDE_TAG_NAME);
      Iterator elementIteratorOverride = overrideTypes.iterator();
      while (elementIteratorOverride.hasNext()) {
        Element element = (Element) elementIteratorOverride.next();
        URI uri = new URI(element.attribute(PART_NAME_ATTRIBUTE_NAME)
            .getValue());
        PackagePartName partName = PackagingURIHelper
            .createPartName(uri);
        String contentType = element.attribute(
            CONTENT_TYPE_ATTRIBUTE_NAME).getValue();
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.