Project

Profile

Help

result-document href gives me an error

Added by Michael Lindeboom over 3 years ago

I am getting an error running Saxon-js in Nodejs. For the following:

  <xsl:result-document href="{$folderName}Dev.json" method="text">

I receive an error:

message: "writeFile('./Dev.json'): expected URL", name: 'XError', code: 'FORG0001', xsltLineNr: '27', xsltModule: 'dl2tm.xsl'

How do I modify this to avoid the error?


Replies (3)

Please register to reply

RE: result-document href gives me an error - Added by Michael Kay over 3 years ago

Are you running from the API or from the command line?

Either way, try to ensure that there is a base output URI specified. From the command line, this is the -o option. From the API, it's the baseOutputURI option to the transform() method.

RE: result-document href gives me an error - Added by Michael Lindeboom over 3 years ago

What would a valid baseOutputURI look like to point to a directory within the node project? This directory would hold the XML output from the translation.

I have been searching for code samples (to give context) on the Saxonica site but found precious few.

RE: result-document href gives me an error - Added by Michael Lindeboom over 3 years ago

Playing around, I found that setting baseOutputURI to file:/ seems to be accepted.

thanks for your earlier reply

Mike

    (1-3/3)

    Please register to reply