您好我正在尝试从xslt文件中删除硬编码的URL,以允许xslt在3个环境中使用。
目前这就是我在XSLT中的方式
<div id="saveAsDraft" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span><span class="sr-only">Close</span>
</button>
<h4 class="modal-title brit-model-title">
Enter description
</h4>
</div>
<div class="modal-body">
<input type="text" class="form-control" ng-model="description" />
</div>
<div class="modal-footer">
<a class="btn btn-primary btn-submit-idea pull-right" data-dismiss="modal" ng-disabled="description == null || description.length === 0" ng-click="saveDraftToServer(false)">
<span class="glyphicon glyphicon-check"></span> OK
</a>
</div>
</div>
</div>
</div>
此文件将在其他环境中使用,所以我想知道有没有办法可以从配置文件或global.asa读取值,所以它可能读起来像
<URL>Https://Website1.net<xsl:value-of select="URL"/></URL>
允许自动部署而无需担心环境问题。 或者这甚至可能吗?
由于
凯文
答案 0 :(得分:0)
我不知道您的解决方案是怎样的,但也许您可以将参数传递给样式表。
可以轻松完成,在样式表上只需更改
<xsl:template match="/">
<xsl:param name="environment"></xsl:param>
<URL><xsl:value-of select="$environment"/><xsl:value-of select="URL"/></URL>
</xsl:template>