- From: Dan Connolly <connolly@w3.org>
- Date: Wed, 14 Dec 2005 11:27:14 -0600
- To: "Henry S. Thompson" <ht@inf.ed.ac.uk>
- Cc: Tim Berners-Lee <timbl@w3.org>, www-tag <www-tag@w3.org>
On Tue, 2005-12-13 at 20:20 +0000, Henry S. Thompson wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Following up on the interesting analogy you drew during today's call > between Python and XML with respect to the value of a single symbol > space within a namespace, I offer the following analogy for > consideration: > > XML Namespace : Element : Attribute > Python package : Method : Local variable You're making a case for scopes, not for multiple top-level symbol spaces. It's straightforward to say that ...html#p refers to the p element type in HTML, and ... ...os#curdir refers to the curdir variable in the os module in python. The tricky bit is what to do about html#title . To say that attributes are scoped to elements is straightforward; it makes them invisible at the outermost scope; that's a little bit of a pain, but not too much. It just means you can't refer to the title attribute using a URI. The main benefit of the doc#term idiom is sharing across formats: "Great multiplicative power of reuse derives from the facts that all languages use URIs as identifiers: This allows things written in one language to refer to things defined in another language." -- http://www.w3.org/DesignIssues/Architecture So to say that html#title refers to the title element type means you don't get a trivially easy way to refer to the title attribute from, say, python. I can live with that. [...] > > It follows that there _is_ no QName-style name, that is, one made of > of Namespace/Package name + local name, which distinguishes between > the two Python variables, just as there is no QName-style name which > distinguishes between the two XHTML attributes. Well, sure there is: it's possible, though perhaps awkward, to mint a URI for the space of attributes of the P element, or for the space of local variables in the swap.formula.compareTerm method. The doc#term idiom doesn't really apply in that case, though, since the compareTerm method isn't published in the web as its own information resource. > If you require a > global unambiguous name for one of the variables, or one of the > attributes, you require a more complex form of name (or URI), which > encodes sufficient information about the context (method or element, > in these cases), to disambiguate. > > I don't think this is a bug, in Python or in XML -- I think it's a > natural pattern of naming. > > ht > > [1] http://dev.w3.org/cvsweb/2000/10/swap/formula.py?rev=1.30&content-type=text/x-cvsweb-markup -- Dan Connolly, W3C http://www.w3.org/People/Connolly/ D3C2 887B 0F92 6005 C541 0875 0F91 96DE 6E52 C29E
Received on Wednesday, 14 December 2005 17:27:27 UTC