Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/jaxen
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15693/src/org/mediavirus/graphl/jaxen
Modified Files:
IterableGraphlAxis.java DocumentNavigator.java
Log Message:
implementing XPath-based filters
Index: DocumentNavigator.java
===================================================================
RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/jaxen/DocumentNavigator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DocumentNavigator.java 30 Jun 2006 14:31:33 -0000 1.1
--- DocumentNavigator.java 3 Jul 2006 15:26:32 -0000 1.2
***************
*** 18,21 ****
--- 18,22 ----
import org.jaxen.saxpath.SAXPathException;
import org.mediavirus.graphl.graph.Edge;
+ import org.mediavirus.graphl.graph.Graph;
import org.mediavirus.graphl.graph.GraphElement;
import org.mediavirus.graphl.graph.Node;
***************
*** 196,199 ****
--- 197,214 ----
}
}
+ else if (contextNode instanceof Graph) {
+ Graph graph = (Graph)contextNode;
+ if (localName != null) {
+ for (Node node : graph.getNodes()) {
+ if (node.getType() != null && node.getType().equals(namespaceURI + localName)) {
+ matchingElements.add(node);
+ }
+ }
+ }
+ else {
+ matchingElements.addAll(graph.getNodes());
+ }
+
+ }
return matchingElements.iterator();
}
Index: IterableGraphlAxis.java
===================================================================
RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/jaxen/IterableGraphlAxis.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IterableGraphlAxis.java 30 Jun 2006 14:31:33 -0000 1.1
--- IterableGraphlAxis.java 3 Jul 2006 15:26:32 -0000 1.2
***************
*** 11,14 ****
--- 11,15 ----
import org.jaxen.UnsupportedAxisException;
import org.jaxen.expr.iter.IterableAxis;
+ import org.jaxen.saxpath.Axis;
***************
*** 19,23 ****
public IterableGraphlAxis(int axisValue) {
super(axisValue);
! this.value = axisValue;
}
--- 20,25 ----
public IterableGraphlAxis(int axisValue) {
super(axisValue);
! value = axisValue;
! if (value == Axis.CHILD) value = Axis.OUT;
}
|