Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python appengine外部名称空间中的lxml_Python_Xslt_Lxml - Fatal编程技术网

Python appengine外部名称空间中的lxml

Python appengine外部名称空间中的lxml,python,xslt,lxml,Python,Xslt,Lxml,有没有一种方法可以配置lxml来获取appengine中的外部xsl模板 我目前在prod中得到错误 XSLTParseError: Cannot resolve URI http://... 即使它在开发中起作用 我像这样从本地文件系统加载XSL def transformXml(xml_content) xsl = file(os.path.join(os.path.split(__file__)[0], 'filename.xslt'),'rb').read() xs

有没有一种方法可以配置lxml来获取appengine中的外部xsl模板

我目前在prod中得到错误

XSLTParseError: Cannot resolve URI http://...
即使它在开发中起作用

我像这样从本地文件系统加载XSL

def transformXml(xml_content)
     xsl = file(os.path.join(os.path.split(__file__)[0], 'filename.xslt'),'rb').read()
     xslt_root = etree.XML(xsl)
     transform = etree.XSLT(xslt_root)
     return unicode(transform(xml_content))
  <xsl:include href="http://../name1.xslt"/>
  <xsl:include href="http://../name2.xslt"/>
  <xsl:include href="http://../name3.xslt"/>
xsl文件包含一些外部xsl文件,这些文件可以像下面这样在线使用

def transformXml(xml_content)
     xsl = file(os.path.join(os.path.split(__file__)[0], 'filename.xslt'),'rb').read()
     xslt_root = etree.XML(xsl)
     transform = etree.XSLT(xslt_root)
     return unicode(transform(xml_content))
  <xsl:include href="http://../name1.xslt"/>
  <xsl:include href="http://../name2.xslt"/>
  <xsl:include href="http://../name3.xslt"/>


请为上下文显示更多代码。另外:您从本地文件系统获取外部样式表的确切位置?外部xsl文件可在线下载,将包含的样式表下载到Python脚本所在的目录中。然后,将
href
路径更改为本地路径。让我知道这是否有效。我无法让它发挥作用。目前,我在openshift中创建了一个WS,它可以进行我需要的转换,并从中获得结果。我会继续努力使它在appengine中发挥作用