Perform XSLT Transform as Build-Step

后端 未结 2 1983
北海茫月
北海茫月 2021-02-12 18:55

During a Visual Studio build, I need to have an XML file generated from another XML file. It is obvious to me an XSLT template and transform is exactly what I need.

The

相关标签:
2条回答
  • 2021-02-12 19:19

    I'd personally go with installing the MSBuild Community Tasks and invoking msbuild.exe from the PostBuild Event in the project settings.

    A shudder just went down my spine at the thought of XSLT files too! :P

    0 讨论(0)
  • 2021-02-12 19:22

    If you're using VS2010 you can use the built-in XslTransformation task of MSBuild 4 in a post build step.

    <Target Name="AfterBuild">
      <XslTransformation
        XslInputPath="transform.xslt"
        XmlInputPaths="in.xml"
        OutputPaths="out.xml" />
    </Target>
    
    0 讨论(0)
提交回复
热议问题