How do I run an XSLT file?

后端 未结 5 1879
谎友^
谎友^ 2020-12-08 18:28

Alright this seems like a stupid question but I can\'t figure it out. I\'m writing an XSLT file to translate an XML document into an XHTML document. I\'ve used both Visual S

5条回答
  •  北海茫月
    2020-12-08 18:41

    In Visual Studio, add the XML file to a project. Open the XML file. When the file is open and its window is active, you should see, in the Properties window, that you can specify an output filename and a stylesheet. Also, you should see that the menu bar now contains an "XML" item.

    If you pick "Show XSLT output" from the "XML" menu, VS will apply the specified transform to the XML file, write its output to the file you specified, and then open that file. If the file has an .xml extension, it'll open it in a text editor window; if it has an .htm extension, it'll open it in a browser window.

    It's a little bit clunky (it seems to me that a menu that appears and vanishes instead of being enabled/disabled is kind of hinky), but it works well enough, and it's in the tool you're already using.

提交回复
热议问题