如何在 xml 中为 xsl 样式表使用相对路径?

how to use a relative path in xml for xsl stylesheet?

这似乎是一个基本问题,但我正在努力让 XML 正常工作。

<?xml-stylesheet href="./nmap.xsl" type="text/xsl"?>

此路径在 Kali Linux/Firefox 中有效,但在 windows 10/chrome 中无效。这在 windows 10/IE*(IE 为胜利)中工作。*

我只是双击 XML 文件。

我也附上文件。 chrome 我遇到黑屏。

XML code

xsl code

Chrome 不允许通过文件系统在本地提供 XSLT。参见

Can Chrome be made to perform an XSL transform on a local file?

您需要通过 http 在本地访问它(使用 IIS 或 IISExpress)。

2021 年 9 月。 您需要手动打开配置才能将其用于 firefox。 https://support.mozilla.org/bm/questions/1264318#answer-1236496