Closed AndrewCampbellSynchronoss closed 8 years ago
That syntax doesn't look quite correct, can you try this?
import com.github.eerohele.SaxonXsltTask
task newXslt(type: SaxonXsltTask) {
...
}
Still not working, but it is differently broken now. This is the build file I am using: build.gradle.txt.
I've added the following lines to the bottom of build.gradle
:
import com.github.eerohele.SaxonXsltTask
task newXslt (type: SaxonXsltTask) {
stylesheet 'xsl/html5.xsl'
input fileTree(dir: 'xml', include: '*.xml')
}
And I'm getting this output:
17:17:46 $ gradle newXslt
:newXslt
Error at procedure title on line 0
XTDE0700: A value must be supplied for parameter $title because there is no default value
for the required type
A value must be supplied for parameter $title because there is no default value for the required type
:newXslt FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':newXslt'.
> A value must be supplied for parameter $title because there is no default value for the required type
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.608 secs
Guessed at various ways of supplying a value for $title, but to no avail.
Something like this should do the trick:
task newXslt (type: SaxonXsltTask) {
stylesheet 'xsl/html5.xsl'
input fileTree(dir: 'xml', include: '*.xml')
// Set XSLT parameters.
parameters(
title: 'Purchase Order',
padding: '0.625rem'
)
}
Note that this issue is really specific to my sample stylesheet (xsl/html5.xsl
), which requires that the title
parameter is set, because I wrote it to use parameters for demonstration purposes.
Ah, the stylesheet was about the one place where I didn't think to look for a parameter!
It works perfectly now, thanks! :+1:
I don't seem to be able to create additional tasks. For example, if I add the following lines to
simple/build.gradle
And run
gradle newXslt
fromsimple
, I get the following error: