Project

Profile

Help

Support #4797

closed

Unknown collection error FODC0002

Added by Nik Osvalds about 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2020-10-19
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

I'm attempting to run saxon-js in NodeJS to apply XSL 3 transformations currently working in another system with Saxon HE, because saxon-js looks like it can offer a lot more versatility.

I am essentially brand new to XSL so the learning curve is steep.

I'm trying to run the iati.xslt transform (attached) on a sample IATI file using saxon-js for Node.js. I've converted the .xslt file on the command line to .sef.json and am calling the transformation in Node. I'm receiving the following error which seems to indicate the the collection(...)'s on line 90 of the .xslt cannot be resolved. I've ensured that the files specified in the collection() are available in my project files.

            // Applying the XSLT3 Ruleset to IATI Files Using SaxonJS
            let results = await SaxonJS.transform({
                stylesheetFileName: "./rules/iati.sef.json",
                sourceFileName: filePath,
                destination: "file",
                baseOutputURI: "./file_storage/validated/" + xmlIn.md5 + '.xml',
            }, "async")
message: 'Unknown collection (no collectionFinder supplied)',
code: 'FODC0002',
xsltLineNr: '90',
xsltModule: 'iati.xslt',
 <xsl:variable name="iati-codelists">
    <codes version="2.03">
      <xsl:apply-templates select="collection('../lib/schemata/2.03/codelist/?select=*.xml;recurse=yes')" mode="get-codelists"/>
      <xsl:apply-templates select="collection('../lib/schemata/non-embedded-codelist/?select=*.xml;recurse=yes')" mode="get-codelists"/>
    </codes>
  </xsl:variable>

I see that you can use the collectionFinder parameter in the transform function but it's unclear how this should be implemented and I've only found documentation on implementing a collectionFinder in Java.

Is this something implemented in Saxon HE (which is presently doing the work) and not currently in Saxon-Js?


Files

iati.xslt (5.26 KB) iati.xslt Nik Osvalds, 2020-10-19 13:56

Please register to edit this issue

Also available in: Atom PDF Tracking page