简体   繁体   English

从YUIBuild文件访问其他XML值

[英]Accessing other XML value from YUIBuild file

I have integrated YUI MSBuild for minification process. 我已经集成了YUI MSBuild用于缩小过程。 In the Build xml file defined for YUI i want to access other property from a xml file. 在为YUI定义的Build xml文件中,我想从xml文件访问其他属性。

I have the version number defined in a xml file located in the project 我在项目中的xml文件中定义了版本号

<add key="VersionNumber" value="1000"/>

Assuming i have the above key in a sample.xml how can i access it from MSBuild project file 假设我在sample.xml中具有上述密钥,如何从MSBuild项目文件访问它

can i do something like this 我可以做这样的事情吗

<ItemGroup>
    <Content Include="constants.xml"/>
</ItemGroup>

Message Text="The output file value @(VersionNumber)"/>  

any help will be aprpeciated 任何帮助将不胜感激

I found the solution for this and thought it will be helpful to post. 我找到了解决方案,并认为发布会有所帮助。 I used the xml read and got it , i used http://msbuildtasks.tigris.org/ 我用xml读取并得到它,我用http://msbuildtasks.tigris.org/

sample code , but my code is different though 示例代码,但是我的代码却不同

 <XmlRead 
  XPath="/add/@connectionString"
  XmlFileName="app.config">
    <Output TaskParameter="Value" PropertyName="MyConnectionString" />
</XmlRead>
<Message Text="MyConnectionString: $(MyConnectionString)"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM