Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在XSL中将xml值作为变量读取_Xml_Xpath_Xslt 2.0 - Fatal编程技术网

在XSL中将xml值作为变量读取

在XSL中将xml值作为变量读取,xml,xpath,xslt-2.0,Xml,Xpath,Xslt 2.0,我有一个不同路径的XML属性文件,它就像 <MyValues> <MyValue1>test</MyValue1> </MyValues> 测验 我想阅读xslt中的MyValue1,在这里我对不同路径中的不同XML进行转换。 我的xsl就像 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http:

我有一个不同路径的XML属性文件,它就像

 <MyValues>
 <MyValue1>test</MyValue1>
</MyValues>

测验
我想阅读xslt中的MyValue1,在这里我对不同路径中的不同XML进行转换。 我的xsl就像

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

 <xsl:variable name="GetMyValue" 

     select="${MyValue1}"/>
 </xsl:stylesheet>


如何从xml中读取MyValue1。

如果您想读取辅助输入文件,那么,给定XSLT 2.0,您可以在
doc
函数和
document
函数之间进行选择。对于单个文件,
doc
就足够了,因此您可以使用例如
声明全局变量或参数,然后将其与例如
一起使用。嗨,我用代码检查了它。doc函数没有读取xml格式的文件。因此,我无法获得eselect=“$input2/MyValues/MyValue1”的输出。当我显示input2时,它不是xml格式。我是否需要添加任何输出方法才能将其作为xml。他正在工作。