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 |
|
|
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 |
|
|
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): |