0

given the following data.xml file:

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

<xml />

I would like to get the following output when accessing http:\\localhost\data.xml?id=my_id:

My id is: my_id

I have the following report.xsl but it does not work for me:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<body>
My id is:
<xsl:param name="id"/>
<xsl:if test="$id=(value)">
<xsl:value-of select="$id"/>
</body>
</xsl:template>
</xsl:stylesheet>
  • Mozillla long time ago introduced some `` for that: https://developer.mozilla.org/en-US/docs/Web/XSLT/PI_Parameters. I don't know whether they still support it or whether other browser vendors have also implemented it. – Martin Honnen Mar 17 '23 at 14:45

1 Answers1

0

Apparently, it is not possible to pass parameters from the xml URL to the XSL: Is it possible to pass a parameter to XSLT through a URL when using a browser to transform XML?