Exemplo n.º 1
0
    def flushStart(self):
        if not self._docOpen:
            if getXMLVersion() != '1.0':
                self._xwr.makePI('xml version="%s"' % getXMLVersion())
            self._toDo()
            if self.prefixes.get(RDF_NS_URI, ":::") == ":::":
                if self.namespaces.get("rdf", ":::") ==":::":
                    self.bind("rdf", RDF_NS_URI)
##                else:
##                    ns = findLegal(self.prefixes, RDF_NS_URI)
##                    self.bind(ns, RDF_NS_URI)
#            if self.prefixes.get(Logic_NS, ":::") == ":::":
#                if self.namespaces.get("log", ":::") ==":::":
#                    self.bind("log", Logic_NS)
            ats = []
            ps = self.prefixes.values()
            ps.sort()    # Cannonicalize output somewhat
            if self.defaultNamespace and "d" not in self._flags:
                if "z" in self._flags:
                    ats.append(('xmlns',
                        self.referenceTo(self.defaultNamespace)))
                else:
                    ats.append(('xmlns',self.defaultNamespace))
            for pfx in ps:
                nsvalue = self.namespaces[pfx]
                if "z" in self._flags:
                    nsvalue = self.referenceTo( nsvalue)
                ats.append(('xmlns:'+pfx, nsvalue))

            self._xwr.startElement(RDF_NS_URI+'RDF', ats, self.prefixes)
            self._subj = None
            self._nextId = 0
            self._docOpen = 1
Exemplo n.º 2
0
    def flushStart(self):
        if not self._docOpen:
            if getXMLVersion() != '1.0':
                self._xwr.makePI('xml version="%s"' % getXMLVersion())
            self._toDo()
            if self.prefixes.get(RDF_NS_URI, ":::") == ":::":
                if self.namespaces.get("rdf", ":::") == ":::":
                    self.bind("rdf", RDF_NS_URI)
##                else:
##                    ns = findLegal(self.prefixes, RDF_NS_URI)
##                    self.bind(ns, RDF_NS_URI)
#            if self.prefixes.get(Logic_NS, ":::") == ":::":
#                if self.namespaces.get("log", ":::") ==":::":
#                    self.bind("log", Logic_NS)
            ats = []
            ps = self.prefixes.values()
            ps.sort()  # Cannonicalize output somewhat
            if self.defaultNamespace and "d" not in self._flags:
                if "z" in self._flags:
                    ats.append(
                        ('xmlns', self.referenceTo(self.defaultNamespace)))
                else:
                    ats.append(('xmlns', self.defaultNamespace))
            for pfx in ps:
                nsvalue = self.namespaces[pfx]
                if "z" in self._flags:
                    nsvalue = self.referenceTo(nsvalue)
                ats.append(('xmlns:' + pfx, nsvalue))

            self._xwr.startElement(RDF_NS_URI + 'RDF', ats, self.prefixes)
            self._subj = None
            self._nextId = 0
            self._docOpen = 1
Exemplo n.º 3
0
    def start(self):
        self._parts = [tm.NOTHING]
        self._triples = [[None, None, None]]
        self._classes = [None]
        self.lists = []
        self._modes = [tm.FORMULA]
        self.bNodes = []
        self._predIsOfs = [tm.NO]
        self._pathModes = [False]
        if not self._docOpen:
            if getXMLVersion() != '1.0':
                self._xwr.makePI('xml version="%s"' % getXMLVersion())
            self._toDo()
            if self.prefixes.get(RDF_NS_URI, ":::") == ":::":
                if self.namespaces.get("rdf", ":::") ==":::":
                    self.bind("rdf", RDF_NS_URI)
#            if self.prefixes.get(Logic_NS, ":::") == ":::":
#                if self.namespaces.get("log", ":::") ==":::":
#                    self.bind("log", Logic_NS)
            ats = []
            ps = self.prefixes.values()
            ps.sort()    # Cannonicalize output somewhat
            if self.defaultNamespace and "d" not in self._flags:
                if "z" in self._flags:
                    ats.append(('xmlns',
                        self.referenceTo(self.defaultNamespace)))
                else:
                    ats.append(('xmlns',self.defaultNamespace))
            for pfx in ps:
                nsvalue = self.namespaces[pfx]
                if "z" in self._flags:
                    nsvalue = self.referenceTo( nsvalue)
                ats.append(('xmlns:'+pfx, nsvalue))

            self._xwr.startElement(RDF_NS_URI+'RDF', ats, self.prefixes)
            self._nextId = 0
            self._docOpen = 1
Exemplo n.º 4
0
    def start(self):
        self._parts = [tm.NOTHING]
        self._triples = [[None, None, None]]
        self._classes = [None]
        self.lists = []
        self._modes = [tm.FORMULA]
        self.bNodes = []
        self._predIsOfs = [tm.NO]
        self._pathModes = [False]
        if not self._docOpen:
            if getXMLVersion() != '1.0':
                self._xwr.makePI('xml version="%s"' % getXMLVersion())
            self._toDo()
            if self.prefixes.get(RDF_NS_URI, ":::") == ":::":
                if self.namespaces.get("rdf", ":::") == ":::":
                    self.bind("rdf", RDF_NS_URI)
#            if self.prefixes.get(Logic_NS, ":::") == ":::":
#                if self.namespaces.get("log", ":::") ==":::":
#                    self.bind("log", Logic_NS)
            ats = []
            ps = self.prefixes.values()
            ps.sort()  # Cannonicalize output somewhat
            if self.defaultNamespace and "d" not in self._flags:
                if "z" in self._flags:
                    ats.append(
                        ('xmlns', self.referenceTo(self.defaultNamespace)))
                else:
                    ats.append(('xmlns', self.defaultNamespace))
            for pfx in ps:
                nsvalue = self.namespaces[pfx]
                if "z" in self._flags:
                    nsvalue = self.referenceTo(nsvalue)
                ats.append(('xmlns:' + pfx, nsvalue))

            self._xwr.startElement(RDF_NS_URI + 'RDF', ats, self.prefixes)
            self._nextId = 0
            self._docOpen = 1