-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does XSpec specify an implicit default context? #73
Comments
I'm not the best person to answer this as I'm just getting to grips with the codebase but I give my two pennies worth contribution - with the risk of stating the obvious or the erroneous. Regarding the -s and -it flag, I can read the following in the Saxon documentation:
The shell script xspec.sh (as well as the batch and ant scripts) are run with both flags: xslt -o:"$RESULT" -s:"$XSPEC" -xsl:"$COMPILED" \
-it:{http://www.jenitennison.com/xslt/xspec}main \ The -s flag is set to the I ran the shell script without the -s flag using the tutorial xspec example : xslt -o:"$RESULT" -xsl:"$COMPILED" \
-it:{http://www.jenitennison.com/xslt/xspec}main \ and it produced the same output at the terminal as well as the same XML and HTML reports. However, I have not yet tested it with the batch and ant scripts nor with an XQuery example. This makes me think that the -s flag is not necessary (let alone inconsistent) and I agree with you that it doesn't make sense to set the XSpec document as the initial context of the transformation. Can anyone see a use case for this? Running it without -s flag is going to break other things? |
I don't know about XSpec, but it's perfectly OK to have both an initial named template and a source document for a transformation. It's useful for example if you want a stylesheet with multiple entry points to do either a summary report or a full report on the same input document. The source document is available (as the value of ".") both within the initial named template, and within global variables. Michael Kay
|
On 14/01/2016 18:48, Adam Retter wrote:
I thought there was a time when you still needed to provide a source
Sometimes the XSpec is all that you have (if you need to supply a source
On mature recollection, it might have been needed for Ant at one time I looked at how Jeni's previous test framework did it, but it used an Regards, Tony. |
@tgraham-antenna So in your conclusion, is it the case that we no longer need to set an initial default context, as there appears to be no current reason to do so? Otherwise, can we somewhere in the XSpec spec have it stated that there is an initial default context which should be the XSpec itself? It would be nice to get this nailed down :-) |
If we look at the scripts provided for executing XSpec:
We see that each of them invoke Saxon to execute the XSpec. However, they also tell Saxon to set the input document to that of the original
foo.xspec
file, by using the-s:
argument, even though they also set an initial named template for execution using the-it:
argument.This doesn't seem to make any sense to me. XSpec provides
x:context
for setting the context of a Scenario. Also I can't imagine why you would ever want a default implicit context which was the content of your XSpec.Is this a mistake/bug or is this by intention? If this is by intention, then can someone please explain what the use-case is, as I can't see it yet!
The text was updated successfully, but these errors were encountered: