0

I'm attempting to debug an XSL using Liquid Studio 2020 Community Edition.

In my XSL definition tag, I included a reference to schemas-microsoft-com.

<xsl:stylesheet version="1.0" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
                exclude-result-prefixes="msxsl" 
                xmlns:cs="urn:cs">

However further down in the document, I have a section that looks like this:

 <xsl:variable name="AllBreakRecords" >
        <Export>
            <xsl:for-each select="msxsl:node-set($AllRecords)//Record">

Liquid Studio is complaining that it "Cannot find a 1-argument function named {urn:schemas-microsoft-com:xslt}node-set()". Sorry I am new to this tool and haven't touched XSL in years so I'm a bit rusty in that also. But it seems like my document should have what it needs to execute this function, provided that Liquid Studio supports it. I did not author the XSL document but have inherited it ;-)

  • `node-set()` is an extension function. Different processors support it in different namespaces. Start by identifying the processor in use - see: https://stackoverflow.com/a/25245033/3016153 – michael.hor257k Sep 22 '20 at 21:41

1 Answers1

0

You might need to make sure you use a Microsoft XSLT processor like any version of MSXML or like XslCompiledTransform or XslTransform in the .NET framework. So check your IDE settings to see whether you have a selection between MSXML or XslCompiledTransform on the one hand or Saxon on the other hand; the error message looks like a Saxon error message. Saxon as an XSLT 2 processor does not need that XSLT 1 specific extension although it, in most versions, supports the community standard EXSLT e.g. xmlns:exsl="http://exslt.org/common" with then e.g. exsl:node-set($AllRecords) as a no-op. In the Microsoft XSLT 1 world only XslCompiledTransform supports the exsl:node-set function together with the msxsl:node-set function. Thus, if you want to run the same code through XslCompiledTransform and Saxon, use exsl:node-set.

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110