Exemplo n.º 1
0
    def asLDML(self, sax, currcontext = None) :
        if not currcontext and self.context :
            sax.startElement('x', AttributesImpl({}))
            if self.context.context :
                sax.startElement('context', AttributesImpl({}))
                sax.characters(self.context.context)
                sax.endElement('context')
            currcontext = self.context
        tag = 'reset' if self.relation == 'r' else self.relation
        sax.startElement(tag, AttributesImpl({}))
        if self.special :
            sax.startElement(self.special, AttributesImpl({}))
            sax.endElement(self.special)
        else :
            sax.characters(self.string)
        sax.endElement(tag)
        
        if currcontext and (not self.child or self.child.context != currcontext) :
            if self.context.extend :
                sax.startElement('extend', AttributesImpl({}))
                sax.characters(self.context.extend)
                sax.endElement('extend')
            sax.endElement('x')
        currcontext = self.context

        if self.child :
            self.child.asLDML(sax, currcontext)
Exemplo n.º 2
0
    def asLDML(self, sax, currcontext=None):
        if not currcontext and self.context:
            sax.startElement('x', AttributesImpl({}))
            if self.context.context:
                sax.startElement('context', AttributesImpl({}))
                sax.characters(self.context.context)
                sax.endElement('context')
            currcontext = self.context
        tag = 'reset' if self.relation == 'r' else self.relation
        sax.startElement(tag, AttributesImpl({}))
        if self.special:
            sax.startElement(self.special, AttributesImpl({}))
            sax.endElement(self.special)
        else:
            sax.characters(self.string)
        sax.endElement(tag)

        if currcontext and (not self.child
                            or self.child.context != currcontext):
            if self.context.extend:
                sax.startElement('extend', AttributesImpl({}))
                sax.characters(self.context.extend)
                sax.endElement('extend')
            sax.endElement('x')
        currcontext = self.context

        if self.child:
            self.child.asLDML(sax, currcontext)
Exemplo n.º 3
0
 def asLDML(self, sax) :
     sax.startElement('collation', AttributesImpl({'type' : self.type} if self.type else {}))
     if len(self.settings) > 0 :
         sax.startElement('settings', AttributesImpl(self.settings))
         sax.endElement('settings')
     sax.startElement('rules', AttributesImpl({}))
     for r in self.rules :
         r.asLDML(sax)
     sax.endElement('rules')
     sax.endElement('collation')
Exemplo n.º 4
0
 def asLDML(self, sax):
     sax.startElement(
         'collation',
         AttributesImpl({'type': self.type} if self.type else {}))
     if len(self.settings) > 0:
         sax.startElement('settings', AttributesImpl(self.settings))
         sax.endElement('settings')
     sax.startElement('rules', AttributesImpl({}))
     for r in self.rules:
         r.asLDML(sax)
     sax.endElement('rules')
     sax.endElement('collation')
Exemplo n.º 5
0
 def asLDML(self, sax) :
     sax.startElement('collations', AttributesImpl({}))
     for c in self.collations :
         c.asLDML(sax)
     sax.endElement('collations')
Exemplo n.º 6
0
 def asLDML(self, sax):
     sax.startElement('collations', AttributesImpl({}))
     for c in self.collations:
         c.asLDML(sax)
     sax.endElement('collations')