Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/57.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
Bash xalan命令行将参数传递给xslt_Bash_Xslt_Parameters_Xslt 1.0_Xalan - Fatal编程技术网

Bash xalan命令行将参数传递给xslt

Bash xalan命令行将参数传递给xslt,bash,xslt,parameters,xslt-1.0,xalan,Bash,Xslt,Parameters,Xslt 1.0,Xalan,我正在尝试使用xalan命令行使用xslt对xml进行命令行处理: () 使用的命令: 使用的Xalan版本: 反复试验 我在命令中尝试了单引号和双引号 并尝试访问xslt中的参数,但仍然无法访问在命令行中传递的参数 我希望能够使用use.xsl中传递的参数来处理use。xml表示“Xalan命令行实用程序当前仅支持顶级样式表参数的文本字符串值。需要使用单引号来标识文本字符串值。”“如果字符串表达式包含空格或shell截取的其他字符,请首先将字符串括在单引号中,以便Xalan-C++将其解释为字

我正在尝试使用xalan命令行使用xslt对xml进行命令行处理:

()

使用的命令: 使用的Xalan版本: 反复试验 我在命令中尝试了单引号和双引号 并尝试访问xslt中的参数,但仍然无法访问在命令行中传递的参数


我希望能够使用use.xsl中传递的参数来处理use。xml表示“Xalan命令行实用程序当前仅支持顶级样式表参数的文本字符串值。需要使用单引号来标识文本字符串值。”“如果字符串表达式包含空格或shell截取的其他字符,请首先将字符串括在单引号中,以便Xalan-C++将其解释为字符串表达式,然后将生成的字符串括在双引号中,以便shell将其解释为单参数。”并给出一个示例
Xalan-p param1”“字符串表达式”foo.xml foo.xsl
。我还没有测试它,但它太长,无法放入注释中,因此作为答案发布。

您的XSLT是否具有全局
?当您说“无法访问参数”时,结果是什么?非常好的发现!
xalan -q -param name_param 'something relevant' -xsl use.xsl -in use.xml
Xalan version 1.11.0
Xerces version 3.2.0