Subject: Re: [xsl] document-uri in MSXML From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 10 Jun 2016 20:02:43 -0000 |
I have a limitation to use MSXML 3.0 only as a XSLT processor but I want to get a URI or full path of source xml document that is being processed. Using Saxon or using XSLT 2.0, I can get it using document-uri(.). But, I don't seem to be able to find way to get it with limited MSXML 3.0 functions.
Can somebody provide help on how to achieve it?
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:js="http://example.com/js" exclude-result-prefixes="msxsl js" version="1.0"> <msxsl:script language="JScript" implements-prefix="js"> function documentUri(nodeSet) { var node = nodeSet.item(0); return node.nodeType === 9 ? node.url : node.ownerDocument.url; } </msxsl:script> <xsl:output indent="yes"/> <xsl:template match="/"> <results> <result> <xsl:value-of select="js:documentUri(/)"/> </result> <result> <xsl:value-of select="js:documentUri(/*)"/> </result> </results> </xsl:template> </xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] document-uri in MSXML, Mandar Jagtap jagman | Thread | Re: [xsl] document-uri in MSXML, Mandar Jagtap jagman |
Re: [xsl] document-uri in MSXML, Michael Kay mike@xxx | Date | Re: [xsl] document-uri in MSXML, Mandar Jagtap jagman |
Month |