Exemplo n.º 1
0
def loadStylesheetPI(doc):
    """This function tries to locate the stylesheet PI in the
      given document If found, and if contained within the
      document, it will extract that subtree to build the
      stylesheet to process @doc (doc itself will be modified).
      If found but referencing an external document it will
      attempt to load it and generate a stylesheet from it. In
      both cases, the resulting stylesheet and the document need
       to be freed once the transformation is done."""
    if doc == None: doc__o = None
    else: doc__o = doc._o
    ret = libxsltmod.xsltLoadStylesheetPI(doc__o)
    if ret == None: return None
    return stylesheet(_obj=ret)
Exemplo n.º 2
0
def loadStylesheetPI(doc):
    """This function tries to locate the stylesheet PI in the
       given document If found, and if contained within the
       document, it will extract that subtree to build the
       stylesheet to process @doc (doc itself will be modified).
       If found but referencing an external document it will
       attempt to load it and generate a stylesheet from it. In
       both cases, the resulting stylesheet and the document need
       to be freed once the transformation is done."""
    if doc == None: doc__o = None
    else: doc__o = doc._o
    ret = libxsltmod.xsltLoadStylesheetPI(doc__o)
    if ret == None: return None
    return stylesheet(_obj=ret)