(self, string)
return fragment
Parse a document fragment from a string, returning the
        fragment node.
Parse a document fragment from a string, returning the
        fragment node.
Parse a document fragment from a string returning the fragment node .
def parseString(self, string):
        """Parse a document fragment from a string, returning the
        fragment node."""
        self._source = string
        parser = self.getParser()
        doctype = self.originalDocument.doctype
        ident = ""
        if doctype:
            subset = doctype.internalSubset or self._getDeclarations()
            if doctype.publicId:
                ident = ('PUBLIC "%s" "%s"'
                         % (doctype.publicId, doctype.systemId))
            elif doctype.systemId:
                ident = 'SYSTEM "%s"' % doctype.systemId
        else:
            subset = ""
        nsattrs = self._getNSattrs() # get ns decls from node's ancestors
        document = _FRAGMENT_BUILDER_TEMPLATE % (ident, subset, nsattrs)
        try:
            parser.Parse(document, True)
        except:
            self.reset()
            raise
        fragment = self.fragment
        self.reset()
##         self._parser = None
        return fragment
def parseString ( self , string ) : self . _source = string parser = self . getParser ( ) doctype = self . originalDocument . doctype ident = "" if doctype : subset = doctype . internalSubset or self . _getDeclarations ( ) if doctype . publicId : ident = ( 'PUBLIC "%s" "%s"' % ( doctype . publicId , doctype . systemId ) ) elif doctype . systemId : ident = 'SYSTEM "%s"' % doctype . systemId else : subset = "" nsattrs = self . _getNSattrs ( ) # get ns decls from node's ancestors document = _FRAGMENT_BUILDER_TEMPLATE % ( ident , subset , nsattrs ) try : parser . Parse ( document , True ) except : self . reset ( ) raise fragment = self . fragment self . reset ( ) ##         self._parser = None return fragment