使用 XSLT 中的 'document' 函数,如何从引用文档的内容中获取值 XML?

Using the 'document' function in XSLT, how do you get the value from the contents of the referenced document which is XML?

现在我调用外部网络服务并将其响应 (XML) 存储为这样的变量(使用 XSL 2.0):

<xsl:variable name="ReturnMICRFormatDocument">
   <xsl:value-of select="document($ReturnMICRFormatFullURL)"/>
</xsl:variable>

然后我尝试从返回文档的 XML:

的特定元素中读取值
<xsl:value-of select="$ReturnMICRFormatDocument/Bank/BankName"/>

... 但它没有产生任何价值。返回示例 XML:

<?xml version="1.0" encoding="utf-8"?>
<Bank xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <RoutingNumber xmlns="">121000248</RoutingNumber>
    <BankName xmlns="">WELLS FARGO BANK</BankName>
    <FormatMatches xmlns="">
        <FormatMatch MatchType="HARD" AccountLength="13">
            <CheckMICRFormat>@121000248@XCCCCCCCCCCCCC*XXXXX</CheckMICRFormat>
            <DepositMICRFormat>@518200392@XCCCCCCCCCCCCC*XXXXX</DepositMICRFormat>
        </FormatMatch>
    </FormatMatches>
</Bank>

在此感谢您的帮助!

只需使用 <xsl:variable name="doc2" select="document($url)"/> 或者,如果您真的想要 xsl:variable 和内部序列构造函数,请使用 xsl:copy-of,而不是 xsl:value-of