Changeset 3070:74f42e694f91 in livinglogic.python.xist

Show
Ignore:
Timestamp:
12/19/07 20:46:57 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Start documenting changes to namespaces.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • MIGRATION.xml

    r3069 r3070  
    2323<par>Many of the XFind operators have been renamed (and all have been rewritten). 
    2424See the <module>xfind</module> documentation for more info.</par> 
     25 
     26</section> 
     27 
     28<section><title>The death of namespace modules</title> 
     29 
     30<par>It's no longer possible to turn modules into namespaces. Element classes 
     31belong to a namespace (in the &xml; sense) simpy if their <lit>xmlns</lit> 
     32attribute has the same value. So a module definition like this:</par> 
     33 
     34<prog> 
     35from ll.xist import xsc 
     36 
     37class foo(xsc.Element): 
     38    def convert(self, converter): 
     39        return xsc.Text("foo") 
     40 
     41class xmlns(xsc.Namespace): 
     42    xmlname = "foo" 
     43    xmlurl = "http://xmlns.example.org/foo" 
     44xmlns.makemod(vars()) 
     45</prog> 
     46 
     47<par>has to be changed into this:</par> 
     48 
     49<prog> 
     50from ll.xist import xsc 
     51 
     52class foo(xsc.Element): 
     53    xmlns = "http://xmlns.example.org/foo" 
     54 
     55    def convert(self, converter): 
     56        return xsc.Text("foo") 
     57</prog> 
    2558 
    2659</section>