[xslt] How to make python bindings fetch entities?



Hi, my first post at this list.

I'm trying to get external entities from other files using the python
bindings for libxml2 and libxslt. The parser seems to recognize them,
but no xml is fetched. No errors are reported. So my question is how to
do this. My code is like this:

import libxml2, libxslt

libxml2.lineNumbersDefault(1)
libxml2.substituteEntitiesDefault(1)
xmlLoadExtDtdDefaultValue = 1
styledoc = libxml2.parseFile("xsl/index.xsl")
style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseFile("index.xml")
result = style.applyStylesheet(doc, None)
stringval = style.saveResultToString(result)

style.freeStylesheet()
doc.freeDoc()
result.freeDoc()
print stringval

I could not make the pyxsltproc do it either, hope someone can help
-- 
Øyvind Hvamstad <oyvind@hvamstad.net>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]