Menu

#1 How implemnt xml to html through xslt?

open
None
9
2009-09-08
2009-09-08
No

Hi all,
I'm trying to transform an xml file to html though xsl:

from Ft.Xml.Xslt import Transform
from Ft.Xml.Xslt import Processor
from Ft.Xml.InputSource import DefaultFactory

document = DefaultFactory.fromUri(xmlfile)
stylesheet = DefaultFactory.fromUri(xsltfile)

processor = Processor.Processor()
processor.appendStylesheet(stylesheet)
result = processor.run(document)
doc = NonvalidatingReader.parseString(result)

but I get this exception:

FtWarning: Creation of InputSource without a URI
Traceback (most recent call last):
File "/home/anturli/workspace/org.etics.plugins.aqcm/src/plugins/AQCMPlugin/AQCMutil.py", line 68, in <module>
xmlToHtml('/home/anturli/etics-workspace/reports/aqcm/org.gcube.vo-management.voms-api-org.gcube.vo-management.voms-api.HEAD.xml', '/home/anturli/etics-workspace/reports/aqcm/xslt/aqcm.xsl','/home/anturli/zzzz.html')
File "/home/anturli/workspace/org.etics.plugins.aqcm/src/plugins/AQCMPlugin/AQCMutil.py", line 60, in xmlToHtml
doc = NonvalidatingReader.parseString(result)
File "/usr/lib/python2.5/site-packages/Ft/Xml/Domlette.py", line 167, in parseString
return self.parse(isrc)
File "/usr/lib/python2.5/site-packages/Ft/Xml/Domlette.py", line 151, in parse
return self.parseMethod(inputSource, *self.args, **self.kwargs)
Ft.Xml.ReaderException: In urn:uuid:e8605c45-7e42-4de4-9d34-138533f9c158, line 8, column 4: mismatched tag

I think it can depend on some html tag without content like img and other. Is it possible? How can I solve this issue?

Thank you for the support

Discussion

  • andrea turli

    andrea turli - 2009-09-08

    xsl file

     
  • andrea turli

    andrea turli - 2009-09-08
    • priority: 5 --> 9
     
  • andrea turli

    andrea turli - 2009-09-08
    • assigned_to: nobody --> uche
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.