/[opental]/opental/OpenTAL/tal_handler.py
ViewVC logotype

Diff of /opental/OpenTAL/tal_handler.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by lalo, Thu Jan 16 22:52:46 2003 UTC revision 1.26 by lalo, Mon Jan 27 07:01:50 2003 UTC
# Line 21  tal_ns = 'http://xml.zope.org/namespaces Line 21  tal_ns = 'http://xml.zope.org/namespaces
21    
22  from pax.paxtransform import AttributeHandler, CompiledInformationHandler, \  from pax.paxtransform import AttributeHandler, CompiledInformationHandler, \
23       AttributeCompiler, StopTransform       AttributeCompiler, StopTransform
24  from pax import XML  from pax import XML, Literal
25  from pax.backwards_compatibility import *  from pax.backwards_compatibility import *
26  import re  import re
27    
# Line 43  def remove_attrs_till(name, element): Line 43  def remove_attrs_till(name, element):
43      while data and pname != name:      while data and pname != name:
44          pname, pdata = data.pop(0)          pname, pdata = data.pop(0)
45    
 class Structure(object):  
     def __init__(self, text):  
         self.text = text  
   
     def __xml__(self, *a):  
         return self.text  
   
46  class Default(Exception):  class Default(Exception):
47      pass      pass
48    
# Line 92  def get_text_or_structure(context, struc Line 85  def get_text_or_structure(context, struc
85      if content is context.getDefault():      if content is context.getDefault():
86          raise Default          raise Default
87      if content and structure:      if content and structure:
88          content = Structure(content)          content = Literal(content)
89      return content      return content
90    
91  def handle_replace(element, context, value):  def handle_replace(element, context, value):

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26