0 Replies Latest reply on Aug 16, 2007 7:55 AM by yair friedman

    problem with attributes of Node - XPath

    yair friedman Newbie

      hi ,

      i am showing a process with it's currrent task (Node) .

      the code that retrieve the measurments of the red box that will wrap
      the Node is :

       public int[] extractBoxConstraint(Element root, Token currentToken) {
       int[] result = new int[4];
       String nodeName = currentToken.getNode().getName();
       XPath xPath = new DefaultXPath("//node[@name='" + nodeName + "']");
       Element node = (Element) xPath.selectSingleNode(root);
       result[0] = Integer.valueOf(node.attribute("x").getValue()).intValue();
       result[1] = Integer.valueOf(node.attribute("y").getValue()).intValue();
       result[2] = Integer.valueOf(node.attribute("width").getValue()).intValue();
       result[3] = Integer.valueOf(node.attribute("height").getValue()).intValue();
       return result;

      the problem is that i get sometimes from the width and height attributes
      value -1 .

      can you please tell me what is the problem , and where, in the deployment itself or in the XPath .