我有一个简单的python,其中定义了styledoc,如下所示
styledoc = libxml2.parseDoc("""
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:foo='http://example.com/foo'
xsl:exclude-result-prefixes='foo'>
<xsl:param name='bar'>failure</xsl:param>
<xsl:template match='/'>
<article><xsl:value-of select='foo:foo($bar)'/></article>
</xsl:template>
</xsl:stylesheet>
""")
我想把所有的数据都包括在一个文件中读.xml像这样的东西
^{pr2}$但是它给了我一个错误“read”没有定义。我犯了什么错误?在
parseDoc
接受一个包含XML的字符串,如第一个示例所示。要解析文件,请改为使用parseFile
:相关问题 更多 >
编程相关推荐