toward XPathb built-ins for cwm, and some code review

Tim, Yosi, and everybody,

I'm trying to use cwm's budding XML support for GRDDL spec work.
I can't get any of the cwm_xml.py built-ins to fire. Are
there any tests for them?

While trying to find the bug...

in term.py, I see...

	if hasattr(self, "evaluate"):
            if (not isinstance(subj, (Literal, CompoundTerm)) or
			not isinstance(obj, (Literal, CompoundTerm))):
                raise ArgumentNotLiteral(subj, obj)
	    return self.evaluate(subj.value(), obj.value())

why not just
  try:
   self.evaluate(subj.value(), obj.value())
and catch exceptions?

why default to self in value()? why not raise ArgumentNotLiteral?

    def value(self):
	"As a python value - by default, none exists, use self"
	return self

in query.py, why catch AssertionError!?!?

	if "q" in self.query.mode:
            caughtErrors = (TypeError, ValueError, AttributeError,
AssertionError, ArgumentNotLiteral, UnknownType)

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E

Received on Tuesday, 13 February 2007 14:22:53 UTC