views:

102

answers:

2

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

+1  A: 

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
A: 

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
I would also use the 'view generated source' tool mentioned in RichardOD's answer sometimes.
artran
When would you choose to use the 'view generated source' tool as opposed to the method you described?
Corey
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