Viewing source in XML to XHTML transformation thro

2019-07-06 22:46发布

问题:

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:

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.



回答2:

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.