if isinstance( node , Node ) :
return node
elif isinstance( node , basestring ) :
- print node
return Text( node )
else :
raise Error( 'Invalid expression of type %s to build tree' % typeOf( node ) )
( 'descendant' , 1 ) ) ,
To( 'descendant' , 1 ) ) ,
- # child::<TEST>/descendant::<TEST>[<PRED>] -> descendant::<TEST>[<PRED>]
- Rule( From( ( 'child' , 1 ) ,
- ( 'predicates' , ( 'descendant' , 1 ) , 2 ) ) ,
- To( 'predicates' , ( 'descendant' , 1 ) , 2 ) ) ,
+# PROBABLY INCORRECT
+# # child::<TEST>/descendant::<TEST>[<PRED>] -> descendant::<TEST>[<PRED>]
+# Rule( From( ( 'child' , 1 ) ,
+# ( 'predicates' , ( 'descendant' , 1 ) , 2 ) ) ,
+# To( 'predicates' , ( 'descendant' , 1 ) , 2 ) ) ,
# descendant-or-self::node()/attribute::<NAME> -> ext:descendant-attribute(<NAME>)
Rule( From( ( 'descendant-or-self' , ( 'node' , ) ) ,