Get an integer in the xml tree.

@param attribute The attribute to get as integer.
@param path The node path (child list)
@return The integer value.
@throws LionEngineException If unable to read node or not a valid integer read.
192135
public final int getInteger(String attribute, String... path)
    {
        try
        {
            return Integer.parseInt(getNodeString(attribute, path));
        }
        catch (final NumberFormatException exception)
        {
            throw new LionEngineException(exception, media);
        }
    }
784257
public Integer getIntObject(String attributeName) {
        String val = get(attributeName, null);
        if (val != null) {
            return Integer.valueOf(val);
        }
        return null;
    }
1349426
public static final long getLongAttribute(Path path, String attribute, LinkOption... options) throws IOException
    {
        return getLongAttribute(path, attribute, -1, options);
    }
869897
private static int convertAttributeToInt(final String attribute) {
        if (attribute == null) {
            return 0;
        }

        try {
            return Integer.parseInt(attribute);
        } catch (final Exception ignore) {
            return 0;
        }
    }
75092
@SuppressWarnings("unchecked")
	static <T> T getAttribute(ObjectName name, String attribute) throws JMException {
		return (T) MBEAN_SERVER.getAttribute(name, attribute);
	}
830370
private String getNodeStringDefault(String defaultValue, String attribute, String... path)
    {
        final Xml node = getNodeDefault(path);
        if (node != null && node.hasAttribute(attribute))
        {
            return node.readString(attribute);
        }
        return defaultValue;
    }
1042452
public Object getAttribute(String attributeName) {
    try {
      final int index = Integer.parseInt(attributeName) - 1;
      if (index < reportable.getMaxEntriesToKeep()) {
        return reportable.get(index).getValue();
      }
    } catch (NumberFormatException e) {
      LOGGER.error("Should never happen! Requested attribute should be an integer but was: " + attributeName);
    }
    return null;
  }
211984
private void write(String attribute, String content)
    {
        Check.notNull(attribute);
        Check.notNull(content);

        try
        {
            root.setAttribute(attribute, content);
        }
        catch (final DOMException exception)
        {
            throw new LionEngineException(exception, ERROR_WRITE_ATTRIBUTE + attribute + ERROR_WRITE_CONTENT + content);
        }
    }
1369845
@Override
	public Attribute getAttribute(int index) {
		Attribute attribute = attributes.get(index - 1);
		return attribute;
	}
4400
public static final int getIntAttribute(Path path, String attribute, LinkOption... options) throws IOException
    {
        return getIntAttribute(path, attribute, -1, options);
    }
478663
public Integer get(String name) throws IOException {
        if (name.equalsIgnoreCase(SKIP_CERTS))
            return (new Integer(skipCerts));
        else
            throw new IOException("Attribute name not recognized by " +
                                  "CertAttrSet:InhibitAnyPolicy.");
    }
1368051
public int readInteger(int defaultValue, String attribute)
    {
        return Integer.parseInt(getValue(String.valueOf(defaultValue), attribute));
    }
813524
public static final long getLongAttribute(Path path, String attribute, long def, LinkOption... options) throws IOException
    {
        attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
        byte[] attr = (byte[]) Files.getAttribute(path, attribute, options);
        if (attr == null)
        {
            return def;
        }      
        if (attr.length != 8)
        {
            throw new IllegalArgumentException(attribute+" not correct type");
        }
        return Primitives.readLong(attr);
    }
829702
def get_attr(obj, path):
    
    try:
        return _get_attr(obj, split_field(path))
    except Exception as e:
        Log = get_logger()
        if PATH_NOT_FOUND in e:
            Log.error(PATH_NOT_FOUND+": {{path}}",  path=path, cause=e)
        else:
            Log.error("Problem setting value", e)
94522
public static Optional<Integer> getIntegerOptional(Config config, String path) {
        return Optional.ofNullable(getInteger(config, path));
    }
365030
public static void convertMXML(String path) throws Exception{
		Map<Integer, String> lines = new HashMap<>();
		List<Integer> lineNumbers = new ArrayList<>();
		String actualLine = "";
		int lineNumber = 0;
		File mxmlfile = new File(path);
		try {
			File file = new File(mxmlfile.getAbsolutePath().substring(0,mxmlfile.getAbsolutePath().indexOf('.'))+"sequentialSort.txt");
			FileWriter output = new FileWriter(file, true);
			XMLInputFactory inputFactory = XMLInputFactory.newInstance();
			XMLStreamReader stax = inputFactory.createXMLStreamReader(new StreamSource(new File(path)));
			boolean element = false;
		
			while (stax.hasNext()) {
				switch (stax.next()) {
				case XMLStreamConstants.START_ELEMENT:
					element = stax.getLocalName().equals("WorkflowModelElement");
					if (stax.getLocalName().equals("ProcessInstance")) {
						String id = getID(stax);
						lineNumber = Integer.parseInt(id.substring(id.indexOf("Case")+4));
						lineNumbers.add(lineNumber);
					}
					break;
				case XMLStreamConstants.CDATA:
				case XMLStreamConstants.CHARACTERS:
					if (!stax.isWhiteSpace() && element) {
						actualLine += stax.getText();
					}
					break;
				case XMLStreamConstants.END_ELEMENT:
					if (stax.getLocalName().equals("ProcessInstance")) {
						actualLine += '\n';
						lines.put(lineNumber, actualLine);
						actualLine = "";
					} else if(stax.getLocalName().equals("WorkflowModelElement")){
						actualLine += '	';
					}
				}
			}
			System.out.println(lineNumbers);
			Collections.sort(lineNumbers);
			System.out.println(lineNumbers);
			for(int line: lineNumbers){
//				System.out.println("write line: "+line);
				output.write(lines.get(line));
			}
			output.close();
		} catch (IOException | XMLStreamException | NumberFormatException e) {
			throw new RuntimeException(e);
		}
	}
1079231
Long getLongAttribute(org.w3c.dom.Node attribute) throws InvalidInputException {
    String s = getStringAttribute(attribute);

    if (s == null) {
      return null;
    }

    try {
      return Long.parseLong(s);
    } catch (NumberFormatException e) {
      throw new InvalidInputException("Invalid input: " + attribute.getNodeName()
          + " must be a int64 value not \"" + s + "\"");
    }
  }