【问题标题】:I am trying to update a value to a path using transform. Need inputs我正在尝试使用转换将值更新为路径。需要输入
【发布时间】:2021-10-10 21:05:46
【问题描述】:

有人可以帮忙解释一下为什么这没有将属性 MaxrequestLength 的值更新为 15000

**Source xml**
<configuration>
  <system.web>
    <httpRuntime targetFramework="4.5" executionTimeout="360" requestValidationMode="2.0" maxRequestLength="100" />  
  </system.web>
  </configuration>

使用的变换如下-

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:template match="@* | node()">
<xsl:copy >
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/configuration/system.web/httpRuntime/@MaxRequestLength">
<xsl:attribute name="{name()}">15000</xsl:attribute>
</xsl:template>
</xsl:stylesheet>

**Output**
<configuration>
  <system.web>
      <httpRuntime executionTimeout="360"
                   maxRequestLength="100"
                   requestValidationMode="2.0"
                   targetFramework="4.5"/>
  </system.web>
  </configuration>

【问题讨论】:

    标签: xslt transform


    【解决方案1】:

    XML 区分大小写。 maxRequestLengthMaxRequestLength 不同。

    【讨论】:

    • 谢谢,我同意,这是一个错字,在我的原始代码中有一个更大的文件,其中包含正确的输入和大小写字母,但它不起作用。将检查转换。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-15
    • 2019-05-22
    • 1970-01-01
    • 2013-09-06
    • 2015-05-02
    • 2015-06-28
    相关资源
    最近更新 更多