3

I'm trying to use an XSL file to transform an XML file into an XHTML file. How can I view the XHTML source that is output after the transformation. I'm currently viewing the results through Firefox, but all I see is the rendered version of the XHTML file. I want to see the source, but when I go to View->Page Source, all I see is the XML. I'm running Ubuntu.

Thanks in advance!

-- Corey

2 Answers2

3

Use the Web developer toolbar, and utilize its View Generated Source option.

From the context menu choose Web Developer --> View Source --> View generated source.

Here's a link to a w3school's XSL sample page if anyone wants to test it out.

RichardOD
  • 28,883
  • 9
  • 61
  • 81
0

I would do the transform on the command line and then point firefox at the generated file until you have the XHTML correct.

The command you need would be something like:

xsltproc -o xshtmlfile.html xslfile.xsl xmlfile.xml

You may need to install libxslt to get the xsltproc command.

artran
  • 310
  • 2
  • 10
  • I would also use the 'view generated source' tool mentioned in RichardOD's answer sometimes. – artran Oct 06 '09 at 18:50
  • When would you choose to use the 'view generated source' tool as opposed to the method you described? –  Oct 06 '09 at 19:07
  • To be honest 'view generated source' is the better choice most of the time when you are producing xhtml. My first solution sprung to mind because I produce other output formats (eg XSL-FO or SVG) more often. – artran Oct 06 '09 at 19:55